Skip to content

Instantly share code, notes, and snippets.

View davidxia's full-sized avatar
🏠
EST working hours

David Xia davidxia

🏠
EST working hours
View GitHub Profile
@davidxia
davidxia / latency.txt
Created June 4, 2012 02:49 — forked from jboner/latency.txt
Latency numbers every programmer should know
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
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD 150,000 ns 0.15 ms
Read 1 MB sequentially from memory 250,000 ns 0.25 ms
Round trip within same datacenter 500,000 ns 0.5 ms
@davidxia
davidxia / lunch_and_learn-2012-9-7.md
Created September 6, 2012 21:43
NYC Lunch and Learn - September 7, 2012 - Neville Li & David Xia

NYC Lunch and Learn

September 7, 2012

Neville Li & David Xia

Use Command Line Shortcuts

Basic

@davidxia
davidxia / Monaco-Powerline.otf
Created September 19, 2012 18:26 — forked from baopham/Monaco for Powerline.otf
Patched font Monaco for OSX Vim-Powerline
#/bin/bash
# Debian package dependencies:
# build-essential - for GCC, GNU Make, etc.
# curl - obviously
# exuberant-ctags - for Vim Tagbar
# git - obviously
# tmux - obviously
# vim-nox - Vim with python and ruby support
# zsh - obviously
@davidxia
davidxia / lunch_and_learn-2012-9-7.md
Created September 20, 2012 20:29
NYC Lunch and Learn - September 21, 2012 - Neville Li & David Xia

NYC Lunch and Learn

September 21, 2012

Neville Li & David Xia

To me vi is zen. To use vi is to practice zen. Every command is a koan. Profound to the user, unintelligible to the uninitiated. You discover truth every time you use it. — Satish Reddy

Vim Basics

@davidxia
davidxia / davidxia.sh
Last active December 15, 2015 14:08
my tmux-powerline theme
# Default Theme
if patched_font_in_use; then
TMUX_POWERLINE_SEPARATOR_LEFT_BOLD="⮂"
TMUX_POWERLINE_SEPARATOR_LEFT_THIN="⮃"
TMUX_POWERLINE_SEPARATOR_RIGHT_BOLD="⮀"
TMUX_POWERLINE_SEPARATOR_RIGHT_THIN="⮁"
else
TMUX_POWERLINE_SEPARATOR_LEFT_BOLD="◀"
TMUX_POWERLINE_SEPARATOR_LEFT_THIN="❮"
@davidxia
davidxia / xcodebuild.sh
Created May 15, 2013 05:42
build xcode project without opening the damned thing
#!/bin/bash
#
# Build and iPhone Simulator Helper Script
# David Xia 2013
#
# WARN: - if your .xcodeproj name is not the same as your .app name,
# this won't work without modifications
# - you must run this script in where your .xcodeproj file is
WORKSPACE=$1
@davidxia
davidxia / fish_prompt.fish
Last active August 29, 2015 13:56
davidxia fish theme
# name: davidxia
# A Powerline-inspired theme for FISH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
## Set this options in your config.fish (if you want to :])
set -g theme_display_user yes
@davidxia
davidxia / keybase.md
Last active August 29, 2015 14:06
keybase.md

Keybase proof

I hereby claim:

  • I am davidxia on github.
  • I am davidxia (https://keybase.io/davidxia) on keybase.
  • I have a public key whose fingerprint is 13B7 FE7F 06B3 7836 0C07 C86A 3446 9DFB DC90 312C

To claim this, I am signing this object:

@davidxia
davidxia / gist:44171398798f260c891be817f2afd501
Last active June 19, 2018 16:03
close all open github PRs in one line with httpie, graphql API, jq, and fish shell
http https://ghe.spotify.net/api/graphql "Authorization: Bearer $github_access_token" query='{
user(login: "davidxia") {
pullRequests(first: 100, states: OPEN) {
totalCount
nodes {
number
repository {
name
owner {
login