In Nelson

Arrived in NZ last week. Spent a few days slowly working my way down the country, stopping off at friends and family on the way.

Have made it to George’s house at long last.

This is what we have been making for the last few days: http://www.games.rekarnar.com/

Anyways, in Nelson now.. starting a new stage. Fun.

Deploying Symfony2 on Dreamhost

There is a few things I had trouble with getting Symfony2 to work on Dreamhost shared hosting. All in all it was quite a mission. So here are some of my steps to help for next time.

We would like to use PHP 5.4. But default the PHP Cli is 5.2. So some changes are required.

Note: Also make sure your domain is set to PHP 5.4 in the Dreamhost Panel.

Step 1:
First we need to enable the custom php.ini, since we also need to add in some extensions for Symfony2. More info here

So to enable PHP 5.4 for all sites, create this folder:
mkdir -p ~/.php/5.4

Step 2:

Then in your .bash_profile in your home folder, add:
export PATH=/usr/local/php54/bin:$PATH
So we are always set with the right version.

Step 3:

Run all the code from the first Gist in your home folder. This will compile the APC extension:

Then open this file and add in the config from the second window above:
vi ~/.php/5.4/phprc

(this enables the required extensions and links the apc module we just made)

Step 4:

From now we we should be set. You can test by running:
$ which php
hopefully it says something like: /usr/local/php54/bin/php

Step 5:

Make sure we have composer:
curl -sS https://getcomposer.org/installer | php

Step 6:

We also need to add in Icu to our require field in composer.json since the Intl Apache module at Dreamhost is a little old. As noted here
"symfony/Icu": "1.1.*"

Step 7:

Next update your project to include that:
php ../composer.phar update --no-dev -o

Step 8:
Perhaps you can do a little dance or something if everything went well. But please celebrate any way you feel appropriate.

2013. Thanks.

2013 Highlights and thanks:

  • Went to 6 counties.
  • Succeeded in travelling the Leh-Manali road.
  • Got to visit my family back in NZ
    • Attended my little brothers wedding
    • Met my uncle whom I had not seen for many years, who then passed on a few months ago.
    • Had a sauna in wellingon!
  • My student loan was paid off
  • Drank 2 litres of milky yoghurt in 7 minutes
  • Thankyou Jesus for all the fun times.

This years plans:

  • To share what I have received in more exotic places
  • To run in fullness of life
  • To make some resolutions

UPDATE:: Things I have just remembered..

  • Ate a stingray

WordPress: How to create a new role in a plugin

Some notes to remember how to create a special functions in a plugin that can only be seen by a user with that role only.

Note this saves to the database, so add it in your plugin activation codes:


$result = add_role(
  'role_name',
   __( 'Fancy Role Name' ),
     array(
     'my_custom_capacity' => true,
     'read' => true
   )
);
$role = get_role( 'administrator' );
$role->add_cap( 'my_custom_capacity' );

Note I also add it into admin role, this is so the admins will also be able to access this.

Then my menus look like this:


add_menu_page( 'Menu Name', 'Menu Name', 'my_custom_capacity', 'plugin_name/plugin_name.php', '', 'http://www.mysite.com/favicon.ico', 67 );

just thinking about the internet..

If you can make something, that would be used for both great good and evil, is it worth making? it is ok to make? should you make it? how do you decide? how do you weigh it up? God made free will, which is the source of great good and also great evil. Love comes from free will (agency) so it is has the potential for such great good, but also unnameable evils have come, but he made it anyways right. Is this a model for us when creating such tools? Should we weight up the greatest good VS the greatest evil possible outcomes and then decide based upon them? Or just do it anyways?