Skip to content

Instantly share code, notes, and snippets.

@anasabbasi
anasabbasi / global_composer_install_with_mamp
Created March 8, 2016 06:17
Install Composer globally with MAMP on Mac OS X
nano ~/.bash_profile
# remember to check php version being used
alias phpmamp='/Applications/MAMP/bin/php/php5.4.10/bin/php'
curl -sS https://getcomposer.org/installer | phpmamp
sudo mv composer.phar /usr/local/bin/composer
composer
@anasabbasi
anasabbasi / reindex.gist
Created January 20, 2016 09:00
Reindex a MySQL table's primary key field. Helpful, if rows have been deleted from the middle and you have an OCD, like me.
SET @newid=0;
UPDATE tablename SET primary_key_id=(@newid:=@newid+1) ORDER BY primary_key_id;