Skip to content

Instantly share code, notes, and snippets.


Stanley Zheng stanzheng

View GitHub Profile
View sass_and_less_compared.markdown

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.


View regex-weburl.js
// Regular Expression for URL validation
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
// Copyright (c) 2010-2018 Diego Perini (
kevinSuttle /
Last active Sep 7, 2021 — forked from lancejpollard/
List of Usable HTML Meta and Link Tags
natos / __request
Created Mar 8, 2012
Multiple Requests with Request (Node.js)
View __request
var request = require('request')
* Handle multiple requests at once
* @param urls [array]
* @param callback [function]
* @requires request module for node ( )
var __request = function (urls, callback) {
mendelgusmao / gist:2356310
Created Apr 11, 2012
high performance URL shortener on steroids using nginx, redis and lua
View gist:2356310
# based on
# using code from
# "database scheme"
# database 0: id ~> url
# database 1: id ~> hits
# database 2: id ~> [{referer|user_agent}]
# database 3: id ~> hits (when id is not found)
# database 4: id ~> [{referer|user_agent}] (when id is not found)
# database 5: key "count" storing the number of shortened urls; the id is generated by (this number + 1) converted to base 62
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname
rayfranco / APACHE: .htaccess pushstate
Created Jul 30, 2012
.htaccess for HTML5 Pushstate support
View APACHE: .htaccess pushstate
<ifModule mod_rewrite.c>
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.html
tj / app.js
Created Aug 31, 2012
users online with redis
View app.js
var express = require('express');
var redis = require('redis');
var db = redis.createClient();
var app = express();
// track users online (replace UA string with user id)
app.use(function(req, res, next){
var ua = req.headers['user-agent'];
caniszczyk /
Created Oct 9, 2012
Clone all repos from a GitHub organization
curl -s | ruby -rubygems -e 'require "json"; JSON.load( { |repo| %x[git clone #{repo["ssh_url"]} ]}'
ndarville /
Last active Sep 13, 2021
Business models based on the compiled list at I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models


Models Examples
Display ads Yahoo!
Search ads Google