Skip to content

Instantly share code, notes, and snippets.

View reactormade's full-sized avatar

Reactormade reactormade

View GitHub Profile
@reactormade
reactormade / lowercase_perl.sh
Created September 4, 2012 12:52
SHELL convert string to lowercase using perl
echo $1|perl -e 'print lc <>;'
@reactormade
reactormade / hidpi.txt
Last active October 9, 2015 15:58 — forked from simX/hidpi.txt
Enable HiDPI mode in Mountain Lion w/o Quartz Debug
//enable HiDPI modes
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES;
//revert to default
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled;
@reactormade
reactormade / git_remove_tag.git
Created August 27, 2012 23:06
GIT remove tag
git tag -d tag
git push origin :refs/tags/tag
@reactormade
reactormade / CI_sessions_table.sql
Created August 25, 2012 17:57
Create CI_Sessions table
CREATE TABLE `sessions` (
`session_id` varchar(40) NOT NULL DEFAULT '0',
`ip_address` varchar(16) NOT NULL DEFAULT '0',
`user_agent` varchar(50) NOT NULL,
`last_activity` int(10) unsigned NOT NULL DEFAULT '0',
`user_data` text NOT NULL,
PRIMARY KEY (`session_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@reactormade
reactormade / days_between_two_dates.php
Created August 22, 2012 12:42
PHP days between two dates
function days_between($day_i,$month_i,$year_i,$day_f,$month_f,$year_f){
$days_in_between = (mktime(0,0,0,$month_f,$day_f,$year_f) - mktime(0,0,0,$month_i,$day_i,$year_i))/86400;
return $days_in_between;
}
//If we want to calculate the days between 21/8/2009 and 1/9/2009 then
echo days_between(21,8,2009,1,9,2009);
//would give us 11
@reactormade
reactormade / default_timezone_set.php
Created August 22, 2012 12:41
CodeIgniter default_timezone_set
if( ! ini_get('date.timezone') ):
date_default_timezone_set('America/Sao_Paulo');
endif;
@reactormade
reactormade / mysql-mamp.sh
Created August 22, 2012 12:40
MSQL on MAMP won't start
killall -9 mysqld
@reactormade
reactormade / executable_script.sh
Created August 21, 2012 21:51
SHELL Make a shell script executable
chmod +x myscript.sh
@reactormade
reactormade / generate.sh
Created August 21, 2012 02:32
Automate project creation
if [ "$1" = "" ] ; then
echo "Must pass a folder name.";
else
cd $HOME/Sites/ && mkdir $1 && cd $1
cp -R ~/Sites/coding/mvc/ .
curl http://code.jquery.com/jquery.js > public/js/jquery.js
fi
@reactormade
reactormade / gist:3410822
Created August 21, 2012 02:26
Force empty trash
sudo rm -rf ~/.Trash/*