Smiley Happy Coder

I'm a web developer with a love of technology and I'm a bit of an Apple geek

Externally connecting MySQL in Vaprobash

This post is more of a note to myself than anything else.

This is becoming a trend for my blog, posts that are only of use to me, but still…

Read On >

How to remap keys on your mac

Ever since I got my first mac one of the biggest frustrations for me was the hash key or pound (#) for the folks in the US.
I decided pretty qucikly that I needed to remap keys, but the question was how.

Being a web developer I use the hash quite a lot. Particularly for CSS and PHP comments. Today I finally got around to doing something about it.
Read On >

Installing Emmett (Zen Coding) on sublime text 3

There are many articles out there that tell you how to install Emmett but a lot of them miss a massive chunk.

The instructions for installing emmett always start with “Install package” but out of the box, that option just isn’t there.
We have to add it first.

Installing package control

In Sublime open the console by pressing
Read On >

Multiple environments with Laravel

laravel
Environments can be a very powerful and quite often nessesity for any applciation and they are made very easy in Laravel.
In my case I need to consider such things as database connections and Stripe keys.

In my workflow I have three environments.

  1. Development
  2. Staging
  3. Production

Read On >

A Laravel csrf Nugget

My good pal @limeblast popped up with a really nice little Laravel csrf nugget the other day.

Add this to the top of your Routes.php file
Route::when('*', 'csrf', ['post', 'put', 'patch', 'delete']);

Now, provided you user the form fa├žade open method, each and every form will be protected from CSRF.

Calling jQuery, http, https or //

Over the years I’ve seen this issue a few times, yesterday I was reminded of it so I thought I would have a dig.
The problem is that when you call an external JavaScript file from, say a CDN, on a secure page you’ll often see an error.

Calling jQuery

Read On >

Having problems installing Laravel on shared hosting? A few pointers

This post is mostly for my own benefit I have to admit.

Laravel on shared hosting

When I’ve set up Laravel on shared hosting in the past I’ve come up against the odd issue.
Read On >

Laravel 4 gotcha

Today I was chucking laravel application onto my server to test it, and I encountered a problem.

Such a simple issue but it could take an age to find.

It worked locally, why won’t it work on a live server

Read On >

Cloning a git repository into the current folder

If you use such services as GitHib or BitBucket then you’ll know that when you clone a repository onto your machine it will generally want to create a new folder. That folder will be named the name of the repo.
Read On >

Get the ID of the last record you inserted into WordPress with $wpdb

So lets say I’m adding records to a table and then I need to add records to a relational table. I need the ID to be able to reference the rows in my pivot table.

Thankfully WordPress makes it silly easy.

Read On >

Where Magento stores the allowed countries

If you ever need to change your allowed countries in Magento you will have to control click each county in the list. I for one miss clicked more than once and lost the lot.
There is no avoiding it, this is just a pain.

A better way

Magento stores the allowed countries in the your database in a table called “core_config_data”

Read On >

Google Analytics, stop tracking visits to my site

By default Google Analytics will track every visitor that lands on your site. Or at least every page that has their snippet installed.

That means that each time you visit your site to check the look of that new page or new CSS rule you’ve been working on, the snippet is fired and Google Analytics see’s a new hit on that page.
The problem now is that your data is effectively skewed as it logs your visits.

Read On >