Mike Whiting

mikewhiting.co. Programming
the free web and other
forms of creativity.

Vagrant Debian Box

Wednesday 14 May 2014

Today I couldn't get synced (shared) folders working first time around with Vagrant and VirtualBox, which lead me to creating my first Vagrant "box" AKA  base system virtual machine image based upon a VirtualBox instance.

Read more...

Psyched

Wednesday 12 March 2014

Yesterday (in-between job hunting) I updated the psychedharma.com website with an "elib-blog" integration that seemed to go pretty smoothly.   The software depends on "elib-base" and Empathy and these are the same three main components that this site also depends on (as well as the templating library Smarty).  The three components can now all be installed using Composer however elib-blog is not currently a stable enough project to be public.  I have also been working towards a new release of Empathy (version 0.9.6)  which will include updated documentation.  All information regarding this micro-framework is gradually starting to be stockpiled over at empathyphp.co.uk. (Notice the attempt at making the project look as official as possible.)  Be warned that finalizing the next release is still in progress and the same is true for the accompanying docs.

Read more...

New Polterghost Website

Thursday 6 March 2014

Subject Tim

Wednesday 26 February 2014

Strasbourg

Thursday 20 February 2014

Sexy Technologies

Tuesday 3 September 2013

Here is my current round-up of technologies that are still getting my blood pumping. The irony here is kind of intentional because not many of these are widely considered to be that sexy. Hint:  From an engineering perspective I believe best practices usually trump new and shiny.

Read more...

Getting Agile Around Happiness

Monday 24 June 2013

A few months ago, after I had explained what I knew about the Agile software development process to a girlfriend of mine (who was showing a keen interest in how that kind of thing worked) she joked that as a user she would like some Marmite, for the benefit of her breakfast.

Read more...

The Happy Messenger

Friday 3 May 2013

This is probably the most long-winded blog post I have ever made but that’s what blogs are for, right! I had the idea in the bath this morning and it was probably due to the strong coffee I had drunk, which I bought from an independent coffee bean outlet in Camden, from which I (uncharacteristically for me these days) sampled again, because we’re out of decaffeinated tea at the moment. The idea was for a start-up that takes the shape of a not-for-profit organisation that seeks to bring global stories to the forefront of people’s attention that concern the successful collaboration between corporations and charities (and other not-for-profits) in the fight against the effects of globalisation, global economic instability and environmental issues... phew!

Read more...

JSON Files and emacs

Tuesday 23 April 2013

I got tired of emacs not knowing I was essentially editing javascript files while writing JSON so I started to look into JS2-mode until I realised it was kind of overkill. Then I saw this comment that suggested telling emacs to use the inbuilt syntax handling for javascrpt for json files too!

(setq auto-mode-alist (cons '("\\.json\\'" . js-mode) auto-mode-alist))

Read more...

Disco Punks

Saturday 20 April 2013

As a result of finally having suitable equipment within reach I've started working on a collection of solo adventures in sound under the arbitrary alias of 'Disco Punks'.  Hopefully this might grow into something a bit more cohesive than usual for my solo 'work'.  I'm currently toying with idea of buying an electronic drumkit to make it easier to make stuff on deh computers.

Read more...

RedBean Models with Composer

Wednesday 13 March 2013

I've finally got to the point where I want to use custom model classes with the RedBean ORM. I personally think this sure speaks volumes for the technology after already using it for various projects for around a year because, as a result, it's reconfirming it's ability to provide 'schemaless' development compared to other ORM technologies. (See DBIx::Class, Doctrine, ActiveRecord etc). Being a Composer convert I automatically wanted to have my models residing in a 'namespaced location' inside my (Empathy) web apps so that they could be auto loaded for me. Although I appreciate the RedBean creator's views on namespaces in PHP, because I think less is often more, I've simply always been a fan, especially since I started to use Composer and becoming aware of the PSR 0 autoloading standard. So assuming I have some 'Acme' components in my web app I would declare them according to the composer documentation as such:

{
    "autoload": {
        "psr-0": {"Acme": "src/"}
    }
}

Read more...

My First Website

Wednesday 30 January 2013

I'm super glad to see today that the first ever website I made is still online that first went up in 1999. Well, I say it's online but 'being cached' is admittedly the more accurate description. This snapshot from archive.org from 2001 has features that include a JavaScript powered "today's date" compoment that seems to be suffering from some kind of millenium bug (just kidding) and a form-to-email page that has field validation and, wait for it,  pop-up windows!

Read more...

PHP Code Style

Saturday 26 January 2013

I recently decided I wanted to apply the PSR-2 strict coding style to my existing PHP code and classes and as result surprised myself how quickly I was able to adopt it naturally in the new code I was writing once I had some similar configuration set across text editors.

Read more...

Blogging

Monday 21 January 2013

After a small amount of deliberation I've decided to put the latest version of my personal blog live again.  You may notice a change in the front-end which I initially started work on over a year ago!  The blog is the same as before, in that it is a custom built web application using my own MVC components together with Smarty but in the latest version the inner dependencies are managed using Composer.  These components are still in the pre-release stages of development but watch this space.

Read more...

Getting current action from view component in symfony

Wednesday 6 April 2011

 

$action =
  $this->getContext()->getActionStack()
  ->getLastEntry()->getActionInstance();
$action->redirect(''); // etc

Serving multiple Symfony apps from one project with one vhost

Thursday 27 January 2011

I have created this simple three step approach for a Symfony project to switch application contexts while respecting the desire to have a global project-wide config file, vhost and default mod_rewrite configuration.  

Read more...

PHP and Slots in Gentoo

Wednesday 24 November 2010

I had a gut-feeling using slots to quickly switch between different versions of PHP in Gentoo would be straightforward and it was.  The only piece of the puzzle that eluded me for a while, in the end, was working out how to tell portage to install a specific version. This is acheieved with an equals sign. As such: (Assuming in this instance 5.2 is already installed.)

Read more...

Detaching a PHP script from the shell on Ubuntu

Thursday 22 July 2010

I've learnt that detaching a PHP script from the shell and allowing it run as a daemon on Ubuntu is not as simple as I first thought.  I couldn't simply add an ampersand like this:

$ php ./script &

Read more...

PHP Mode for emacs on Mac OS X

Thursday 20 May 2010

It's been a long time since I figured this out and I can't remember what resource I used to help me. Anyway to get PHP Mode working with the native emacs bundled with Mac OS X do the following:

$ mkdir elisp; cd elisp
$ wget http://bit.ly/cLqD47

Read more...

Name of current module controller or action from Yii view

Wednesday 21 April 2010

I've been using Yii framework a fair bit recently and it seems very nice so far.  However I couldn't easily find out how to get hold of these often essential pieces of information from a Yii view.  Useful in situations where you want to build a navigation user interface element etc. This is all you need to know...  

// Module
if(isset($this->module)): echo $this->module->getName(); endif;

// Controller
echo $this->ID;

// Action
echo $this->action->id;

MVC

Friday 1 January 2010

Welcome to the first live site to use the latest version of my own MVC (for use with Smarty) that is now successfully running on top of PHP 5.3.  Recent work on it has been a fun ride, driven mostly out of a desire to have controller classes whose names do not clash with those of auto-generated classes from PHP Doctrine. i.e. they would potentially still clash if it wasn't for namespaces :0]

Read more...

Perl 5 point 10 in layman terms

Wednesday 9 September 2009

As a developer, one of the great things I love about Gentoo (Linux distribution with BSD 'ports-like' package management) is the feeling it gives you that eveything you do to your system has an undo button. (For the record, I have at least come to my senses about this need in a production situation.)  A great example of this is layman, which I think is fair to say is a slightly more intuitive version of managing an apt sources file.  Today I realised there is a portage overlay (for use with layman) that I have been missing out on and perhaps it's because it's a fairly recent addition but it comes just in time for me to try and get more serious about hacking in Perl.

Read more...

Its pretty clear that soon everyone will be speaking XML

Friday 4 September 2009

I'm going to be ordering 'XMPP: The Definitive Guide' today (ISBN 059652126X).  I have a project coming up which, fingers crossed, will be an ideal opportunity to become versed in this technology. I remember a few years ago, when I came across the Jabber project, I was really excited about it and started using the Exodus IM client all time. I even got my girlfriend (at the time) to register an account.  I also remember going to stpeter's website and taking pointers for creating a decent personal websites (which wasn't a blog).  I remember thinking this was eventually going to be *huge* and I'm kind of kicking myself now that it never occured to me, that like a lot exciting open source technology, people will eventually be adopting it without even know they're doing it, or at least not realising the significance of its openness.  Exciting times. Anyway enough with the jibber-jabber, apparently I have a 'decent read' to get through and this one isn't a Hermann Hesse novel.

Running a Symfony application from a directory

Wednesday 2 September 2009

Step 1 - Install Symfony into your PHP library path:

# cd /usr/share/php
# wget http://www.symfony-project.org/get/symfony-stable.tgz
# gunzip symfony-stable.tgz ; tar -xvf symfony-stable.tar
# ln -s symfony-X/lib symfony
# mkdir data
# ln -s ../symfony-X/data data/symfony
# rm syfony-stable.tar

Read more...