Skip to content

Instantly share code, notes, and snippets.

@honktang
honktang / rAF.js
Created April 16, 2012 08:19 — forked from paulirish/rAF.js
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller
// fixes from Paul Irish and Tino Zijdel
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
@honktang
honktang / 1. local
Created August 7, 2012 08:33
Make localhost as web server
#local
ssh -NfR 8080:localhost:80 user@honktang.com
@honktang
honktang / nginx.conf
Created August 20, 2012 08:22
Custom Domain for Dropbox Public Directory
server{
listen 80;
server_name xxx.com;
location / {
set $index index.html;
rewrite ^.*\/$ $fastcgi_script_name$index last;
proxy_pass http://dl.dropbox.com/u/xxxxxxxx/;
proxy_redirect off;
@honktang
honktang / vhost.js
Created September 10, 2012 07:06 — forked from billywhizz/vhost.js
Example of vhosts in node.js
var http = require("http");
/*
add following to your hosts config to test:
10.11.12.8 www.vhost1.net
10.11.12.8 www.vhost2.com
10.11.12.8 www.vhost3.test.com
10.11.12.8 static.vhost1.net
@honktang
honktang / .bashrc(local)
Created September 21, 2012 04:35
git pull/push without password , msysgit on windows
#eval `ssh-agent`
#ssh-add
// Based on ICanHaz (http://github.com/andyet/ICanHaz.js/blob/master/ICanHaz.js)
// This version supports Mustache and Handlebars
// By M@ McCray
;var render = (function($, engine){
var cache = {},
methods = {};
$(function(){
$('script[type="text/html"]').each(function () {
var name = $(this).attr('id'),
git --git-dir=/path/to/repo.git --work-tree=. init && echo "gitdir: /path/to/repo.git" > .git
@honktang
honktang / restart_dropbox.bat
Last active February 1, 2017 17:42
Restart Dropbox
echo off
set app="%AppData%\Dropbox\bin\Dropbox.exe"
taskkill -F -IM "Dropbox.exe"
start "Restart Dropbox" %app% -B;
@honktang
honktang / GoogleSheetJson.md
Created June 6, 2017 02:45 — forked from ronaldsmartin/GoogleSheetJson.md
Google Spreadsheet JSON Queries

SheetAsJSON + Filtering

This is an extension of DJ Adams' excellent SheetAsJSON Google Apps Script, which provides a way to GET a published Google Spreadsheet as a JSON feed. This version allows generic filtering for terms, more specific control over which rows to parse, and correct MIME type for JSONP output.

Minimal Usage

The following parameters are required for the script to work.

https://script.google.com/macros/s/AKfycbzGvKKUIaqsMuCj7-A2YRhR-f7GZjl4kSxSN1YyLkS01_CfiyE/exec?
+ id=<spreadsheet key>
+ sheet=<sheet name on spreadsheet>