Skip to content

Instantly share code, notes, and snippets.

View tsing's full-sized avatar
🦀

Jesse Wang tsing

🦀
View GitHub Profile
// ==UserScript==
// @name Google Reader + Diigo
// @namespace http://google.com/reader/userscript
// @description Adds reader posts to Diigo when clicked
// @include http://google.com/reader/*
// @include http://*.google.com/reader/*
// @include https://google.com/reader/*
// @include https://*.google.com/reader/*
// ==/UserScript==
<?php
$apc_key = 'geowhycommentsrss';
$life = 600;
$api = 'http://pipes.yahoo.com/tsing/geowhycomments?_render=rss';
$timeout = 2;
header("Cache-Control: max-age=$life");
if (! function_exists('apc_fetch')) {
function apc_fetch($key) {
<?php
if ($_SERVER["GEOWHY_CDN_ENABLED"] != "1")
{
return;
}
require_once dirname(__FILE__)."/global.php";
require_once dirname(__FILE__)."/plugin.php";
$geowhycdn = new Geowhy_CDN();
@tsing
tsing / ensure.js
Created February 10, 2010 02:07
ensure.js, inspired by ensure.js on codeplex.com
var ensure = (function() {
var loader = function() {};
loader.prototype = {
queues: { js: {}, css: {} },
load: function(data, callback, context) {
if (! data.css) data.css = [];
if (! data.js) data.js = [];
this.queueCSS(data.css, this.bind(function() {
var posix = require('posix'),
sys = require('sys'),
http = require('http');
http.createServer(function (req, res) {
checkBalanceFile(req, res);
}).listen(8000);
function checkBalanceFile(req, res) {
var promise = posix.stat("balance");
@tsing
tsing / ed2kHash.py
Created May 28, 2012 15:00 — forked from fcicq/ed2kHash.py
ed2kHash class for python
# by fcicq (fcicq at fcicq dot net) @ 2012.5.12, Released under GPLv2
import hashlib
from cStringIO import StringIO
class ed2kHash():
CHUNK_SIZE = 9728000
BLOCK_SIZE = 65536
chunkmd4_list = ''
chunkmd4 = None
chunkpos = 0
@tsing
tsing / hack.sh
Created July 9, 2012 13:36 — forked from DAddYE/hack.sh
OSX For Hackers
#!/bin/sh
##
# This is a script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# Run in interactive mode with:
# $ sh -c "$(curl -sL https://raw.github.com/gist/2108403/hack.sh)"
#
# or run it without prompt questions:
@tsing
tsing / proxy-tunnel.py
Created January 23, 2013 07:56
create tunnel through http proxy
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import SocketServer
import socket
import logging
import select
import threading
import signal
import argparse

Keybase proof

I hereby claim:

  • I am tsing on github.
  • I am tsing (https://keybase.io/tsing) on keybase.
  • I have a public key whose fingerprint is 8981 879F 8B21 DEEF 6E1A 2A60 EDA2 A071 02D5 AA36

To claim this, I am signing this object:

docker images |grep none
abcd