philipnorton42's blog

Changing Submit Input Elements Into Buttons In Drupal 7

Friday, November 16, 2012 - 12:09

I spent what seemed like an eternity today trying to figure out something in a form I was creating on a Drupal site. I was building a multi step form with previous and next buttons, both of which were submit elements like this.

Category: 

Creating Mac OSX Aliases

Saturday, November 10, 2012 - 21:01

Adding an alias to your system is a good way of saving time when remembering complex commands. You can reduce a command down to a quick two letter command that is easy to remember.

The alias command can be used to assign an alias on the fly. You can create an alias to 'ls -lah' by typing in the following into the command line.

alias ll="ls -lah"

Now, when you type 'll' you will actually run the command 'ls -la'.

Category: 

Checking Syntax Errors In PHP And JavaScript Using Phing

Monday, October 29, 2012 - 22:26

Checking Syntax Errors In PHP And JavaScript Using Phing

Running a simple syntax check over your files is a good way to save time. This can be when testing code but best practice is to not to even commit code that contains syntax errors.

You can syntax check a single file using the -l (lowercase L) flag with the PHP executable like this.

Category: 

Happy Birthday Bash Script

Monday, October 29, 2012 - 11:58

Following on from the PHP script to print happy birthday I wanted do the same in a bash script. I don't really use bash for much more than stringing together commands so I had to figure out how to do loops and if statements using the simple bash syntax. I also wanted to pass the name of the person as an argument, rather than hard code it into the script. This is what I came up with.

Category: 

Happy Birthday PHP Script

Monday, October 29, 2012 - 11:43

When posting happy birthday messages to developers over social media I like to write it in code, just to be geeky. The following code will print the happy birthday song using PHP.

Category: 

PHPNW12: A Review

Saturday, October 20, 2012 - 14:58

The annual PHPNW conference gets better every year, and this year was no exception. I have been going to the PHPNW conference since their inception in 2008 and this year I was lucky enough to be involved in some of the pre-conference organising and helping out over the event.

Category: