A different take on the loading icon. HTML and CSS.
A Pen by matt henley on CodePen.
| <?php | |
| class Registry { | |
| /** | |
| * @var array The store for all objects | |
| */ | |
| static private $store = array(); | |
| /** |
| <?php | |
| /** | |
| * Get either a gravatar URL or a complete image tag for a specified email | |
| * | |
| * @param string $sEmail The email address | |
| * @param string $sSize The size on pixels, defaults to 80px [ 1 - 2048 ] | |
| * @param string $sDefault Default imageset to use [ 404 | mp | identicon | monsterid | wavatar ] | |
| * @param string $sRating Maximum rating (inclusive) [ g | pg | r | x ] | |
| * @param boolean $bImg True to return the complete img-tag, false for just the URL |
| #ui | |
| .bg | |
| .rings | |
| - for (i = 0; i < 10; i++) | |
| .ring | |
| .border |
| <?php | |
| //The content which should be parsed | |
| $content = '<p>Hello, my name is John an my age is [calc-age day="4" month="10" year="1991"].</p>'; | |
| $content .= '<p>Hello, my name is Carol an my age is [calc-age day="26" month="11" year="1996"].</p>'; | |
| //The array with all the shortcode handlers. This is just a regular associative array with anonymous functions as values. A very cool new feature in PHP, just like callbacks in JavaScript or delegates in C#. | |
| $shortcodes = array( | |
| "calc-age" => function($data){ | |
| $content = ""; | |
| //Calculate the age |
| <svg class="editorial" | |
| xmlns="http://www.w3.org/2000/svg" | |
| xmlns:xlink="http://www.w3.org/1999/xlink" | |
| viewBox="0 24 150 28 " | |
| preserveAspectRatio="none"> | |
| <defs> | |
| <path id="gentle-wave" | |
| d="M-160 44c30 0 | |
| 58-18 88-18s | |
| 58 18 88 18 |
| <div class="toggle"> | |
| <input type="checkbox" class="check"> | |
| <b class="b switch"></b> | |
| <b class="b track"></b> | |
| </div> |
A different take on the loading icon. HTML and CSS.
A Pen by matt henley on CodePen.
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace TextAdventure | |
| { | |
| class Exit | |
| { |
| <?php | |
| function cache_set($key, $val) { | |
| $val = var_export($val, true); | |
| // HHVM fails at __set_state, so just use object cast for now | |
| $val = str_replace('stdClass::__set_state', '(object)', $val); | |
| // Write to temp file first to ensure atomicity | |
| $tmp = "/tmp/$key." . uniqid('', true) . '.tmp'; | |
| file_put_contents($tmp, '<?php $val = ' . $val . ';', LOCK_EX); | |
| rename($tmp, "/tmp/$key"); | |
| } |