Skip to content

Instantly share code, notes, and snippets.

@ironsjp
ironsjp / cls.js
Created July 18, 2011 14:42
cache script and css to localStorage (same domain only)
/**
* 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() {
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);
}
<?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,
<?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);
}
}
?>