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
'use strict'; | |
function fuzzySearch (subject, pattern) { | |
var i = 0, n = -1, l; | |
subject = subject.toLowerCase(); | |
pattern = pattern.toLowerCase(); | |
for (; l = pattern[i++];) | |
if (!~(n = subject.indexOf(l, n + 1))) |
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
'use strict'; | |
var i = 0 | |
, defender = [] | |
, attacker = [] | |
, len = Math.max(defender.length, attacker.length); | |
function mathPair () { | |
return selectName(defender) + ' & ' + selectName(attacker); | |
} |
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
'use strict'; | |
var i = 0 | |
, names = [] // add names here | |
, len = (names.length / 2); | |
function matchPair () { | |
return selectName() + ' & ' + selectName(); | |
} |
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
$('*').each(function () { | |
var colors = ['aqua', 'blue', 'fuchsia', 'gray', 'green', 'lime', 'maroon', 'navy', 'olive', 'orange', 'purple', 'red', 'silver', 'teal', 'yellow']; | |
$(this).css('background-color', colors[Math.floor(Math.random()*colors.length)]); | |
$(this).css('font-family', 'Comic Sans MS'); | |
}); | |
$('img').each(function () { | |
var imgs = [ | |
'http://www.animatedgif.net/devilish/coolskul.gif', | |
'http://www.animatedgif.net/devilish/devildance_e0.gif', |
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 ip() { | |
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { | |
if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== FALSE) { | |
$ip = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); | |
return trim(end($ip)); | |
} else { | |
return $_SERVER['HTTP_X_FORWARDED_FOR']; | |
} | |
} else { | |
return $_SERVER['REMOTE_ADDR']; |
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 multiRequest($data, $connecttimeout = 10, $timeout = 10) { | |
$curly = array(); | |
$result = array(); | |
$mh = curl_multi_init(); | |
foreach ($data as $id => $d) { | |
$curly[$id] = curl_init(); | |
$url = (is_array($d) && !empty($d['url'])) ? $d['url'] : $d; |
NewerOlder