This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo $1|perl -e 'print lc <>;' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git tag -d tag | |
| git push origin :refs/tags/tag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if( ! ini_get('date.timezone') ): | |
| date_default_timezone_set('America/Sao_Paulo'); | |
| endif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| killall -9 mysqld |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| chmod +x myscript.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo rm -rf ~/.Trash/* |