Using composer with your projects
- Details
- Created on Saturday, 30 March 2013 23:20
Composer is a great tool for managing the dependencies in your project.
I must admit, I’ve only just started using it and can already see how powerful and easy to use it is.
There are many good articles on how to set it up, so I’ll go over the basics on getting started in your own project with a basic Hello World example.
PHPUnit issues in Mac OS X Mountain Lion
- Details
- Created on Thursday, 07 March 2013 23:42
Having managed to install PHPUnit in my mac at work with no problems, found it odd - to say the least - that I was having so many issues at my personal one.
So here is the issue I was having. I set the $PATH with the location of of PHPUnit but when run phpunit --version, I got a bad request error.
After trying different ways of installing/uninstalling, I fixed it by changing the first line of PHPUnit as it wasn’t pointing to the right location of php.
#!/usr/local/Cellar/php54/5.4.11/bin/php
First steps with jQuery and Curl.js
- Details
- Created on Sunday, 03 February 2013 18:58
Having used Dojo for a number of years, I really like its modularity.
Now, however there is a format for writing modular javascript - AMD. For a nice intro, look here: http://addyosmani.com/writing-modular-js/
I’ve only just started looking into it, so here is a small example with my first steps.
I chose to use Curl.js (https://github.com/cujojs/curl)
The directory structure I’m using is the following:
jQuery_curl
|__ lib
|__ curl
|__ jquery
|__ projectA
|__ slides
|__ styles
I have created a simplified slider with text which you can slide to the left and to the right.
I am using a slide object for the slide’s node and content.
A model for adding some logic
And lastly a script that initialises the slider app
The template is also simple. Just load the two main libraries: curl and jquery and create the base path for your applications:Here is also the css that goes with it. It is created for four slides. However, we can easily pass the style attribute through the model to make this more js driven.
Monitoring mysql queries
- Details
- Created on Saturday, 05 January 2013 19:03
Recently whilst working on a ZF application doing some simple MySQL joins, I couldn't figure out why a query wasn't working.
As I couldn't find out through code what statement the framework was building, I turned to MySQL.
Edit mysql configuration. In ubuntu default setup will be under:
/etc/mysql/my.cnf
There are two lines which need to uncommented in order to enable the logs:
general_log_file = /var/log/mysql/mysql.log general_log = 1
Now restart the mysql service
sudo service mysql restart
If you like to see queries run at real time, then use tail:
tail -f /var/log/mysql/mysql.log

