This file contains 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 | |
// Make any text 'excerpty' | |
function excerptify($text, $length = 140){ | |
return trim(substr($text, 0, strpos($text, ' ', $length))) . '...'; | |
} |
This file contains 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 todays_item($arr){ | |
$count = count($arr); | |
$number = floor(time() / 86400) % $count; | |
return $arr[$number]; | |
} | |
$arr = array( | |
'One', | |
'Two', | |
'Three' |
This file contains 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 is_prime($number) { | |
return !preg_match('/^1?$|^(11+?)\1+$/x', str_repeat('1', $number)); | |
} |
This file contains 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 | |
$consumerKey = /*CONSUMER KEY*/; | |
$consumerSecret = /* CONSUMER SECRET*/; | |
$authContext = stream_context_create(array( | |
'http' => array( |
NewerOlder