Skip to content

Instantly share code, notes, and snippets.

View wilsonqin's full-sized avatar

Wilson Qin wilsonqin

View GitHub Profile
@fdb
fdb / Cargo.toml
Last active May 30, 2021 13:27
Calling Rust from C++
[package]
name = "vec"
version = "0.1.0"
authors = ["Frederik De Bleser <frederik@debleser.be>"]
[lib]
name = "vec"
crate-type = ["dylib"]
[dependencies]
@randyzwitch
randyzwitch / seaborn-stacked-bar.py
Created September 8, 2014 21:08
Python Seaborn Stacked Bar Chart
import pandas as pd
from matplotlib import pyplot as plt
import matplotlib as mpl
import seaborn as sns
%matplotlib inline
#Read in data & create total column
stacked_bar_data = pd.read_csv("C:\stacked_bar.csv")
stacked_bar_data["total"] = stacked_bar_data.Series1 + stacked_bar_data.Series2
@BryanDonovan
BryanDonovan / nodejs-mocha-jakefile.js
Last active December 14, 2015 03:39
Example jakefile to run mocha tests
var Mocha = require('mocha');
var mocha = new Mocha({reporter: 'spec', ui: 'bdd'});
function run_tests(cb) {
mocha.addFile('./test/foo.unit.js');
mocha.run(function(failures) {
cb(failures);
});
}
@simenbrekken
simenbrekken / Makefile
Created September 6, 2012 00:01
Annotated Makefile for combining and minifying LESS/CSS and JavaScript assets.
# Specify where our binaries are (I'm using package.json and npm to handle dependencies)
LESSC = node_modules/.bin/lessc
UGLIFYJS = node_modules/.bin/uglifyjs
# Our LESS input file(s)
LESS = css/base.less
# Our CSS list (replaces .less with .css in the list)
CSS = $(LESS:.less=.css)
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@jboner
jboner / latency.txt
Last active June 15, 2024 23:05
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@nuxlli
nuxlli / sublime_text_2_useful_shortcuts.md
Created September 9, 2011 18:51 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@didip
didip / supervisord-example.conf
Created January 30, 2011 05:10
Example configuration file for supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon