Skip to content

Instantly share code, notes, and snippets.

View corvofeng's full-sized avatar
Do You Want To Build A Snowman.

corvofeng corvofeng

Do You Want To Build A Snowman.
View GitHub Profile
@philpoore
philpoore / time-docker-build.sh
Created September 5, 2018 19:13
Generate JSON output of docker build step timing, useful for profiling
#!/bin/bash
# script: time-docker-build.sh
#
# All command line arguments are passed to docker build command.
#
# usage: ./time-docker-build.sh
#
DATE_FORMAT="+%s"
@troykinsella
troykinsella / process-erb.rb
Created February 2, 2017 23:56
Evaluate an ERB template, injecting a YAML file of variables.
#!/usr/bin/env ruby
require 'erb'
require 'yaml'
class HashBinding
def initialize(hash)
@hash = hash.dup
end
def method_missing(m, *args, &block)
@akatrevorjay
akatrevorjay / git-fshow
Last active March 30, 2024 23:41 — forked from junegunn/gist:f4fca918e937e6bf5bad
Browsing git commit history with fzf
#!/bin/zsh
# git-fshow - git commit browser
#
# https://gist.github.com/akatrevorjay/9fc061e8371529c4007689a696d33c62
# https://asciinema.org/a/101366
#
git-fshow() {
local g=(
git log
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@brainsik
brainsik / color_log.py
Created September 24, 2011 03:51
ANSI colored Python logging
import logging
from termcolor import colored
class ColorLog(object):
colormap = dict(
debug=dict(color='grey', attrs=['bold']),
info=dict(color='white'),
warn=dict(color='yellow', attrs=['bold']),
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000