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
<?php | |
$string = 'hello world'; | |
$start_time = microtime(); | |
for ($i = 0; $i < $max = 10000000; $i++) { | |
strtolower($string); | |
} | |
$timed = microtime() - $start_time; | |
echo 'strtolower ' . $string . ' - ' . $timed . '<br>'; |
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 convert_youtube(input) { | |
var pattern = /(?:http?s?:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=)?(\S+)/g; | |
if (pattern.test(input)) { | |
var replacement = '<iframe width="420" height="345" src="http://www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe>'; | |
var input = input.replace(pattern, replacement); | |
// For start time, turn get param & into ? | |
var input = input.replace('&t=', '?t='); | |
} | |
return input; | |
} |
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
// http://stackoverflow.com/a/5727346/3774582 | |
// Parse CRON frequency | |
// Break it down like James Brown | |
function parse_crontab($time, $crontab) { | |
// Get current minute, hour, day, month, weekday | |
$time = explode(' ', date('i G j n w', strtotime($time))); | |
// Split crontab by space | |
$crontab = explode(' ', $crontab); | |
// Foreach part of crontab | |
foreach ($crontab as $k => &$v) { |
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
@font-face { | |
font-family: hellogoodbye; | |
src: url(/chan/stylesheets/fonts/hellogoodbye.otf); | |
} | |
body { | |
background: #FFFFFF url('img/fade-miku.png') repeat-x 50% 0%; | |
color: black; | |
font-family: arial, helvetica, sans-serif; | |
font-size: 10pt; |