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
| 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
| 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
| //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
| 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
| anchor(base_url().'sample/'.$object->hash,'<span class="btn btn-mini btn-info"><i class="icon-search icon-white"></i> View</span>',array('data-remote'=>base_url().'sample/'.$object->hash,'data-toggle'=>'modal','data-target'=>'#modal-sample')); | |
| $('#modal-sample').on('hidden', function() { | |
| $(this).removeData('modal'); | |
| }); | |
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 mkdir -p /Library/Server/Mail/Data/spool | |
| sudo /usr/sbin/postfix set-permissions | |
| sudo /usr/sbin/postfix start |
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 get_url_parameter(name) { | |
| return decodeURI( | |
| (new RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[null])[1] | |
| ); | |
| } |
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
| /* apply a natural box layout model to all elements */ | |
| * { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } |
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 extract_matching_string_from_array($array_of_strings, $comparison){ | |
| $array = array(); | |
| foreach ($array_of_strings as $string): | |
| if (strstr($string, $comparison)): | |
| array_push($array, $string); | |
| endif; | |
| endforeach; | |
| return $array; | |
| } |