Skip to content

Instantly share code, notes, and snippets.

View trujunzhang's full-sized avatar

Trujun Zhang trujunzhang

View GitHub Profile
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
1. Cask
alias ci='cask --verbose'
2. brow
alias bwi="bower install"
alias bwl="bower list"
alias bws="bower search"
alias bibs="bower install -save-dev "
@trujunzhang
trujunzhang / 0_reuse_code.js
Created January 28, 2016 03:32
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
atom-sync-settings:
@trujunzhang
trujunzhang / ReactNative-Deep-Dive.md
Created January 29, 2016 12:48 — forked from nsimmons/ReactNative-Deep-Dive.md
ReactNative Deep Dive
@trujunzhang
trujunzhang / Install Composer to use MAMP's PHP.md
Created February 23, 2016 03:15 — forked from kkirsche/Install Composer to use MAMP's PHP.md
How to install Composer globally using MAMP's PHP

##Create an alias to MAMP's PHP installation

To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

Within the terminal, run:

nano ~/.bash_profile

This will open nano with the contents, at the top in a blank line add the following line:

@trujunzhang
trujunzhang / hosted_example.txt
Created April 30, 2016 07:26 — forked from makevoid/hosted_example.txt
JQuery DOM HighLighter (it's a basic "Inspect element" simple implementation to mimic what webkit inspector and firebug do)
http://uploads.makevoid.com/jquery_dom_highlighter.html
@trujunzhang
trujunzhang / extractGifs.py
Created July 30, 2016 06:30 — forked from revolunet/extractGifs.py
extract frames from animated gif using python+PIL
import os
from PIL import Image
def extractFrames(inGif, outFolder):
frame = Image.open(inGif)
nframes = 0
while frame:
frame.save( '%s/%s-%s.gif' % (outFolder, os.path.basename(inGif), nframes ) , 'GIF')
nframes += 1
@trujunzhang
trujunzhang / README.md
Created August 28, 2016 06:03 — forked from timothyandrew/README.md
Set up a seedbox (on DigitalOcean – Ubuntu) really quick

Introduction

  • This script lets you set up and use a temporary DigitalOcean droplet to download torrent files.
  • Once downloaded, they can be streamed down to your local machine.
  • This uses transmission-cli for the torrent client, and nginx to serve files.

Setup on Local Machine

  • This assumes that you have a DigitalOcean account and tugboat set up, as well as seedbox-setup.sh present in the current directory.
@trujunzhang
trujunzhang / tornado-nginx-example.conf
Created September 4, 2016 15:30 — forked from didip/tornado-nginx-example.conf
Nginx config example for Tornado
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
}