Skip to content

Instantly share code, notes, and snippets.

View jacobbubu's full-sized avatar

Rong Shen jacobbubu

  • Li Auto.
  • Beijing, China
View GitHub Profile
@spoike
spoike / reflux.js
Created June 29, 2014 22:23
A simpler implementation of React.JS's Flux
var EventEmitter = require('events').EventEmitter,
_ = require('lodash');
/**
* Creates an action functor object
*/
exports.createAction = function() {
var action = new EventEmitter(),
eventLabel = "action",
@jgeurts
jgeurts / gist:5847108
Created June 24, 2013 00:49
Install nginx on Ubuntu 13.04
# From: http://www.cyberciti.biz/tips/using-nginx-as-reverse-proxy.html
# and: http://www.cyberciti.biz/faq/howto-linux-unix-setup-nginx-ssl-proxy/
# and: http://nginx.org/en/docs/http/websocket.html
# Run the following commands as su
sudo -s
# Use the stable version of nginx
nginx=stable
# Add nginx repository source
add-apt-repository ppa:nginx/$nginx
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@adammw
adammw / README.md
Created August 3, 2012 06:30
Node.js for Raspberry Pi

Node.js for Raspberry Pi

Pre-built binaries

Recent releases have been pre-built using cross-compilers and this script and are downloadable below.

If you have found these packages useful, give me a shout out on twitter: @adammw

@tobiash
tobiash / qredis.coffee
Created June 6, 2012 20:30
Q + node_redis
# Applies Q.nbind to all redis operations and returns a wrapped client
_ = require("underscore")._
Q = require "q"
nbindOps = (client) ->
functions = _.functions client
# All the ops are available as upper/lowercase functions, I exploit this
# to filter out the Redis operations from the other functions of the client
#
/*
In a child process, each of the stdio streams may be set to
one of the following:
1. A new file descriptor in the child, dup2'ed to the parent and
exposed to JS as a Stream object.
2. A copy of a file descriptor from the parent, with no other
added magical stuff.
3. A black hole - no pipe created.
@isaacs
isaacs / comma-first-var.js
Created April 6, 2010 19:24
A better coding convention for lists and object literals in JavaScript
// See comments below.
// This code sample and justification brought to you by
// Isaac Z. Schlueter, aka isaacs
// standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog",