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; |
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
$('*').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
'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
'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'; | |
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
// rgb is a array [r, g, b] | |
function colorContrast (rgb) { | |
var r = rgb.r * 255, | |
g = rgb.g * 255, | |
b = rgb.b * 255; | |
var factor = (r * 299 + g * 587 + b * 114) / 1000; | |
return (factor >= 128) ? 'dark' : 'light'; | |
} |
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 | |
$ip = '127.0.0.1'; | |
$port = '9051'; | |
$auth = 'PASSWORD'; | |
$command = 'signal NEWNYM'; | |
$fp = fsockopen($ip,$port,$error_number,$err_string,10); | |
if(!$fp) { echo "ERROR: $error_number : $err_string"; | |
return false; |
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
<? | |
preg_replace("/&([a-z])[a-z]+;/i", "$1", htmlentities($valor)); |
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
-- | URL Doc : http://hackage.haskell.org/package/url-2.1.3/docs/Network-URL.html | |
module Page where | |
import Network.URL | |
import Network.Curl | |
import Text.XML.HXT.Core | |
import Text.HandsomeSoup | |
data Page = Page { | |
title :: String, |
OlderNewer