Skip to content

Instantly share code, notes, and snippets.

View snipe's full-sized avatar
😩
So jetlag. Much tired.

snipe snipe

😩
So jetlag. Much tired.
View GitHub Profile
@snipe
snipe / currency_symbols.php
Created November 4, 2015 06:33 — forked from gibbs/currency_symbols.php
An array of currency symbols as HTML entities
<?php
$currency_symbols = array(
'AED' => '&#1583;.&#1573;', // ?
'AFN' => '&#65;&#102;',
'ALL' => '&#76;&#101;&#107;',
'AMD' => '',
'ANG' => '&#402;',
'AOA' => '&#75;&#122;', // ?
'ARS' => '&#36;',
'AUD' => '&#36;',
@snipe
snipe / linux-ci
Created February 16, 2013 04:34
Initial setup for Linux server to prepare for CI using Jenkins and PHP unit tests
yum install openssl-devel git php ant php-xml php-devel gcc make gcc-c++ freetype-devel fontconfig-devel
# Install node.js
cd /usr/local/src
wget http://nodejs.org/dist/v0.8.15/node-v0.8.15.tar.gz
tar zxvf node-v0.8.15.tar.gz
cd node-v0.8.15
# Install npm and n for easier updating
@snipe
snipe / date-php-ini
Created February 16, 2013 04:36
Set the date in php.ini
vi /etc/php.ini
# add to php.ini:
zend_extension="/usr/lib64/php/modules/xdebug.so"
# Update timezone
date.timezone = 'AMERICA/New_York'
@snipe
snipe / add-gh
Created February 16, 2013 04:37
If your source code is hosted on GitHub, you'll want to add GH to your known hosts on your CI server to prevent issues during automated code checkout later as well.
ssh-keyscan -H github.com > /etc/ssh/ssh_known_hosts
@snipe
snipe / gist:4965564
Created February 16, 2013 04:39
Grab php jenkins template
curl https://raw.github.com/sebastianbergmann/php-jenkins-template/master/config.xml | java -jar jenkins-
cli.jar -s http://localhost:8080/cli create-job php-template
@snipe
snipe / gist:4965565
Created February 16, 2013 04:39
Reload jenkins
java -jar jenkins-cli.jar -s http://localhost:8080 reload-configuration
@snipe
snipe / ant-build
Created February 16, 2013 04:41
Sample ant target block
<target name="build" depends="prepare,lint,phploc,phpmd,phpcpd,phpcs,phpunit"></target>
@snipe
snipe / mysql-strict
Created November 26, 2013 23:17
Turn on mysql strict mode for Mac OSX mysql/MAMP
As priv'd user,
SET @@global.sql_mode='STRICT_TRANS_TABLES';
SET @@global.sql_mode='STRICT_ALL_TABLES';
@snipe
snipe / DbmigrateController.php
Created February 13, 2016 07:12 — forked from oilop9000/DbmigrateController.php
Laravel 4 Convert existing MySQL database to migrations. This is a fork of Lee Zhen Yong https://gist.github.com/bruceoutdoors/9166186 fork from Christopher Pitt's work http://laravelsnippets.com/snippets/convert-an-existing-mysql-database-to-migrations, which is based off michaeljcalkins's work at http://paste.laravel.com/1jdw#sthash.0nEgQzQR.dpuf
<?php
/* * **
*
* This script converts an existing MySQL database to migrations in Laravel 4.
*
* 1. Place this file inside app/controllers/
*
* 2. In this file, edit the index() method to customize this script to your needs.
* - inside $migrate->ignore(), you pass in an array of table
@snipe
snipe / harryPotterAliases
Created June 13, 2016 04:13 — forked from graceavery/harryPotterAliases
bash aliases for Harry Potter enthusiasts
alias accio=wget
alias avadaKedavra='rm -f'
alias imperio=sudo
alias priorIncantato='echo `history |tail -n2 |head -n1` | sed "s/[0-9]* //"'
alias stupefy='sleep 5'
alias wingardiumLeviosa=mv
alias sonorus='set -v'
alias quietus='set +v'