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.
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'.
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.
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.
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.
Over the last few week (months even) myself and a team of amazing people from the North West Drupal User Group (NWDUG) have been working on putting together a DrupalCamp in the north west of UK. The culmination of this effort is DrupalCampNW2012, which will be 23rd-25th of November.
I very recently took delivery a 15 inch MacBook Pro (my first Apple computer) and I thought I would write about my reasoning behind it. Normally, people don't tend to ask why you bought a computer, but with Apple products it seems to be different. I think I have stated my reasons to a few different people already, so I thought it would make a good blog post.
If you want to use Zend Framework in Drupal then most of the time you can use the Zend module. This takes a little configuration but will include the framework and instantiate the Zend_Loader_Autoloader class so that everything is ready to run.
The other day I was inspired by a story on Reddit about a guy who had created a Python script to automatically play the olympic hurdles Google Doodle. The Python script just passed the correct keyboard commands to the game so that the game was finished in 1.5 seconds, earning a gold medal.
Selenium is an application that allows automated testing of websites through a browser and consists of a number of different components. It allows the creation of browser tests that perform certain actions, which can then be run again at a later date. Three components are required to allow Selenium to run tests through PHP. These are as follows: