Skip to content

Instantly share code, notes, and snippets.

<?
$table = json_decode(file_get_contents('emoji.json'));
//print_r($table); //take a peak
foreach ($table as $k => $emoji)
foreach ($emoji->short_names as $shortname)
echo "'{$shortname}' => '{$emoji->unified}', \n";
?>
<?
$emoji_unicode = array(
'copyright' => '00A9',
'registered' => '00AE',
'bangbang' => '203C',
//...etc.
}
?>
<?
require('emoji_unicode.php');
$text = "hello :world_map: . it's :hammer: :stopwatch:.";
//alphanumeric, hyphens, plus-signs, and underscores string, wrapped in colons
preg_match_all("/:([a-zA-Z0-9'_+-]+):/", $text, $emojis);
foreach ($emojis[1] as $emojiname)
if (isset($emoji_unicode[$emojiname]))
#bookshelf {
width:156px;
margin: 0 auto;
}
.book {
-webkit-filter: grayscale(1);
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;
background-size:cover;
<?
$curl_options = array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER =>; false,
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_ENCODING => "",
CURLOPT_AUTOREFERER => true,
CURLOPT_CONNECTTIMEOUT => 8,
CURLOPT_TIMEOUT => 8,
CURLOPT_MAXREDIRS => 3,
<?
// read cache and convert XML to ARRAY
$data_cache = explode($breaker,file_get_contents($cache));
$reading = new SimpleXMLElement($data_cache[0]);
$read = new SimpleXMLElement($data_cache[1]);
echo "<div id='bookshelf'>";
// cycle through currently reading (@TODO i dont know if cycle works nativily, only developed with 1 book in shelf. sometimes they change the xml structure when >1. would need to change)
foreach ($reading->reviews->review as $reading)
ErrorDocument 404 /index.php
<?
ob_end_flush();
for( $i = 0 ; $i < 10 ; $i++ ) {
echo $i;
flush();
ob_flush();
sleep(1);
}
?>
<?
@ini_set('zlib.output_compression',0);
@ini_set('implicit_flush',1);
@ob_end_clean();
set_time_limit(0);
header( 'Content-type: text/html; charset=utf-8' );
ob_implicit_flush(1);
for($i=0; $i<10; $i++){
echo $i;
<?
$navigation_relation = array();
$navitems = wp_get_nav_menu_items('your-nav');
foreach ($navitems as $navobject)
$navigation_relation[$navobject->ID] = $navobject->object_id;
print_r($navigation_relation);
?>