I hereby claim:
- I am hexus on github.
- I am hexusio (https://keybase.io/hexusio) on keybase.
- I have a public key ASB-gUFx_IbUUk73bTRmcKkfaYTRqOkd8DaLJiUcQPVGzgo
To claim this, I am signing this object:
| <?php | |
| fwrite(STDOUT, "What's your name?\n"); | |
| $name = ucfirst(trim(fread(STDIN, 2048))) ?: 'No-name'; | |
| fwrite(STDOUT, "Thanks, $name\n"); | |
| fwrite(STDERR, "Unfortunately, $name, your name is so abysmal, it's caused an error\n", 100); | |
| fwrite(STDERR, "But it's okay, we still care about you\n"); | |
| fwrite(STDOUT, "How would you like to say good bye?\n"); | |
| fread(STDIN, 2048); | |
| fwrite(STDERR, "Good bye, $name. Nobody loves you.\n", 100); |
| var game = new Phaser.Game({ | |
| type: Phaser.WEBGL, | |
| width: 1280, | |
| height: 720, | |
| backgroundColor: '#2d2d2d', | |
| parent: 'phaser', | |
| scene: { | |
| preload: preload, | |
| create: create, | |
| update: update |
I hereby claim:
To claim this, I am signing this object:
| <?php | |
| // It would be nice if PHP had something like this built in | |
| function asplode($delimiter, $string, $limit, $pad = null) { | |
| return array_pad(explode($delimiter, $string, $limit), $limit, $pad); | |
| } | |
| // Then things like this wouldn't cause an error without array_pad() | |
| list($one, $two) = explode(' ', 'nospaces', 2); | |
| // We're forced to do this, and it's just ugly and tedious |
| var throttle = function(callback, timeout, context) { | |
| timeout = timeout || 0; | |
| context = context || this; | |
| if (typeof callback === 'function') { | |
| var last = 0; | |
| return function() { | |
| var time = new Date().getTime(); | |
| <?php | |
| class Setters { | |
| protected $data = array(); | |
| public function oldFriendlyAdd($key, $value = null) { | |
| if (is_array($value)) { | |
| $values = $value; | |
| /** | |
| * Helper function for consistent path values. | |
| * | |
| * @param string $path | |
| * @return string | |
| */ | |
| function NormalisePath($path) | |
| { | |
| return preg_replace('#[\\\|/]+#', '/', trim($path, '\/')); | |
| } |
| // Webogram speech recognition! - courtesy of Hexus | |
| var recognition = new webkitSpeechRecognition(); | |
| recognition.continuous = true; | |
| recognition.onresult = function(event){ | |
| var result = event.results[event.resultIndex][0]; | |
| var transcript = result.transcript; | |
| var transtripped = transcript.replace(/[\s\r\n]+/,''); // Spaces with every transcript but the first | |
| var inputElement = document.getElementsByClassName('im_send_form')[0].getElementsByClassName('form-control')[1]; | |
| console.log(result); | |
| switch(transtripped){ |
| function dateDiff($date1,$date2=null){ | |
| if(!$date2){$date2 = 'now';} | |
| $date1 = new DateTime($date1); | |
| $date2 = new DateTime($date2); | |
| return $date1->diff($date2); | |
| } | |
| function prettyDate($date){ | |
| $diff = static::dateDiff($date); | |
| $intervals = array('s'=>'second','i'=>'minute','h'=>'hour','d'=>'day','m'=>'month','y'=>'year'); |
| $(function(){ | |
| var hasPopped = false; | |
| // XHR request wrapper for page content | |
| $.loadPage = function(href,data,callback,method){ | |
| $.ajax(href,{ | |
| dataType: 'html', | |
| data: data, | |
| type: method, | |
| success: function(response){ |