This file contains 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
/** | |
* cache script and css to localStorage (same domain only) | |
* | |
* $CLS.style("a.css"); | |
* | |
* $CLS.script("jquery-1.5.2.min.js").wait() | |
* .script("a.js") | |
* .script("b.js") | |
* .script("c.js") | |
* .wait(function() { |
This file contains 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 createHandler(fn, obj) { | |
return function(){ fn.apply(obj, arguments) }; | |
} | |
function a(e) { | |
console.log(this.a, e.clientX); | |
} | |
function b(e) { | |
console.log(this.b, e.clientX); | |
} |
This file contains 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 TwitterAPI { | |
private $_curl_handle; | |
private $_curl_info; | |
private $_curl_errno; | |
private $_curl_errmsg; | |
private $_curl_options = array( | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_HEADER => false, | |
CURLOPT_FOLLOWLOCATION => true, |
This file contains 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 | |
for ($i = 0; $i < 256; $i++) { | |
for ($j = 0; $j < 256; $j++) { | |
$dir = sprintf("data/twitter/friends/%02x/%02x", $i, $j); | |
mkdir($dir, 0777, true); | |
} | |
} | |
?> |