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
// Case 1 | |
// will display '9223372036854775807 equals 9223372036854775808' | |
// bug https://bugs.php.net/bug.php?id=54547 | |
$a = '9223372036854775807'; | |
$b = '9223372036854775808'; | |
if ($a == $b) | |
echo "$a equals $b\n"; |
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 | |
function glob_recursive($pattern, $flags = 0) { | |
$files = glob($pattern, $flags); | |
foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) { | |
$files = array_merge($files, glob_recursive($dir.'/'.basename($pattern), $flags)); | |
} | |
return $files; | |
} |
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 | |
set_time_limit(0); | |
function glob_recursive($pattern, $flags = 0) { | |
$files = glob($pattern, $flags); | |
foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) { | |
$files = array_merge($files, glob_recursive($dir.'/'.basename($pattern), $flags)); | |
} | |
return $files; | |
} |
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 | |
class Singleton { | |
public static $aliases = array(); | |
protected static $_adapters = array(); | |
public function __construct () { | |
throw new LogicException("you cannot instanciate Singleton"); |
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 ($_='[["accueil","messages","contact","vider"],["Menu","Votre message","d/m/Y H:i:s","message","Envoyer","Me Contacter","[email protected]","chat.log","Fichier supprimé","Messages"]]') &&($_GET+=['p'=>null]) &&in_array($p = $_GET['p'], (($j=json_decode($_,true))&&($s=$j[0])&&($w=$j[1])) ? $s : array()) ?($s[0]==$p &&array_shift($s) &&print('<h1>'.$w[0].'</h1><ul><li>'.implode('</li><li>',array_map('sprintf',array_fill(0, count($s), '<a href="?p=%s">%s</a>'),$s,$s))))||($r=sprintf('<a href="?p=%s">%s</a>',$s[0],$s[0])) &&(($s[1]==$p &&vprintf('<h1>%s</h1>%s<hr/>%s<hr/>'.$r,array($w[3],sprintf('<form action="?p=%s" method="post"><input name="n" placeholder="%s"><button type="submit">%s</button></form>',$p,$w[1],$w[4]),((isset($_POST['n']) &&($h = fopen($w[7],'a+')) &&fwrite($h, date($w[2]).": {$_POST['n']}\n")) ? '' : '').'<p>'. implode('</p><p>',is_file($w[7]) ? array_reverse(file($w[7])) : array()). '</p>')))||($s[2]==$p &&printf('<p><a href="mailto:%s">%s</a></p>'.$r,$w[6],$w[5]))|| |
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 domReady (callback) { | |
!/in/.test(document.readyState) | |
? setTimeout(function () { domReady(callback) }, 1000) | |
: callback(); | |
})(function () { | |
console && console.log('dom is ready'); | |
}); |
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
[ | |
{ | |
"name": "Pink", | |
"hex": "ffc0cb", | |
"rgb": "255,192,203" | |
}, | |
{ | |
"name": "LightPink", | |
"hex": "ffb6c1", | |
"rgb": "255,182,193" |
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 () { | |
'use strict'; | |
var get_synchronizer = function (delay, callback) { | |
var pretime = new Date().getTime(); | |
return function () { | |
var curtime = new Date().getTime(); | |
console.log(curtime - pretime); | |
if (curtime - pretime >= delay) { | |
callback(); |
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
#!/bin/bash | |
function usage { | |
echo "Usage: $0 [file] [start|stop|status|connect]" | |
} | |
if [ -z $1 ]; then | |
usage | |
exit 0 | |
fi |
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 | |
spl_autoload_register(function($classname) { | |
if (strpos($classname, '\\with') === false) | |
return false; | |
list($namespace, $class) = str_split($classname, strrpos($classname, '\\')); | |
$class = substr($class, 1); | |
$parts = explode('\\with', $classname); |
OlderNewer