Updating git in OSX

Recently there was a critical vulnerability in git announced affecting many git users including myself on OSX.

After downloading and installing the latest version of git and entering in Terminal

git −−version

I was presented with the incorrect version number. Checking where it had been installed with

which git

displayed the original

/usr/bin/git

instead of the newly installed version at

/usr/local/git/bin

To resolve this I added the correct path (to my bash profile)

export PATH=”/usr/local/git/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:$PATH”

and now which git correctly returned the new path and bumped the version

git version 2.0.1

Hide or show hidden files quickly in OSX

How to setup some quick shortcuts to toggle visibility of hidden files in Finder

  • In Terminal type: sudo nano ~/.bash_profile
  • Append to the file the following: alias showFiles=’defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app’
  • In a new line type: alias hideFiles=’defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app’
  • Save the file
  • To make the aliases available in Terminal type: source ~/.bash_profile

Now you have two additional commands: showFiles and hideFiles to make things easier.

CodeIgniter Cart class product name restrictions

codeigniter logo

The CodeIgniter cart class has a non immediately apparent feature regarding special characters in the Product Name. Within the Cart library the line

var $product_name_rules = ‘\.\:\-_ a-z0-9’; // alpha-numeric, dashes, underscores, colons or periods

will strip out any non defined special characters. While you could hack this line, the correct way to do this is to extend the library and create an over-ride.

Create a new file application/libraries/MY_Cart.php

<?php if ( ! defined(‘BASEPATH’)) exit(‘No direct script access allowed’);

class MY_Cart extends CI_Cart {

function __construct() {
parent::__construct();

// Remove limitations in product names
$this->product_name_rules = ‘\d\D’;
}
}

Note this will allow all characters, you may want to limit to specified special characters.

MySQL upgrade and planned outage announcement

mysql_logo

MySQL v5.1 Upgrade

Our upstream provider is upgrading MySQL on your server from version 5.0 to version 5.1 as part of their commitment to web hosting security and performance.

This is an important change to ensure continued compatibility with current and future software and to ensure the stability and security of services for all customers.

For most users this change will have minimal impact on websites hosted with us and the latest releases of popular software such as Joomla and WordPress are already compatible with this upgrade.

This is a good time for you to ensure your software installations are current because you could experience problems if it has been designed around earlier versions of MySQL. We also ask that you check to make sure that any custom code is compatible with the newer version of MySQL.

For more detailed information about this upgrade please visit the official MySQL page Upgrading from MySQL 5.0 to 5.1

The upgrade is scheduled to start between the 30th and 31st of July 2013. The upgrades will begin after 21:00hrs GMT and shouldn’t take any longer than 60 minutes.