CSV file of Windows Process list
If you need a CSV file of the currently running processes in Windows you can use the task manager command line tool. C:> TASKLIST.EXE This will dump the task list…
PHP App Testing
Think: “What am I testing?” 1) Set-up Instantiate your class Look for dependencies, are there any that need mocking? 2) Exercise We test our real objects that need testing, or…
Resetting forgotten MySQL root password
If you have forgotten your root password for MySQL, then don’t panic. Although, if you don’t have root shell access, then do panic! Anyway, to reset a password, you need…
Changing your MySQL root password
When you installed MySQL, you would have been asked for a root password. If you were testing or something similar, you may have used an empty password. This is all…
How to pass data from Controller to Zend Form
To pass data from your controller, to a Zend_Form, you can utilise the config parameters: $this->view->form = new Contact_Edit_Form(array('contactName' => 'Chris')); This will pass a very simple array to the…
Zend Console – get values passed
When using a CLI script with options, I like to use the Zend_Console. If my options are as follows: $console = new Zend_Console_Getopt( array( 'i-s' => 'test option 1', 'e'…
JQuery – bind event to non existant element
We all have to bind events to elements: $('#link).click(function(){ do some stuff }); But, what if that element doesn’t exist yet? Well, you can use the “live” handler: $('#link').live('click', function(){…
Facebook – Download *all* of your data
You can download all the data you’ve ever uploaded to Facebook if you like. Once you are logged in, click this link: https://www.facebook.com/editaccount.php?ref=mb&drop and press the “Download your information” link.…
MySQL Query Profiling
This inbuilt part of MySQL allows you to look closely at queries run – per session. And you can use this information to find bottlenecks. To enable profiling, run this…
Showing hidden files on Mac OS
Learning MacOS recently, and couldn’t find some hidden files, i.e. .htaccess To fix this, easy. Open Terminal, and paste the following in (both lines together), and press enter. Done. defaults…