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
@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;
// 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 / url_to_drive.js
Created June 2, 2017 07:54 — forked from denilsonsa/url_to_drive.js
Google Apps Script to upload a file from an URL directly to Google Drive.
// url_to_drive.gs
// Google Apps Script
// Allows uploading a URL directly to Google Drive.
//
// Live link:
// https://script.google.com/macros/s/AKfycbzvhbHS4hnWPVBDHjQzZHA0qWq0GR-6hY7TbYsNto6hZ0MeAFZt/exec
//
// Source-code:
// https://gist.github.com/denilsonsa/8134679
// https://script.google.com/d/1Ye-OEn1bDPcmeKSe4gb0YSK83RPMc4sZJt79SRt-GRY653gm2qVUptoE/edit