Skip to content

Instantly share code, notes, and snippets.

@pengmeng
pengmeng / timeme.py
Last active January 7, 2016 06:10
A timer context manager
__author__ = 'mengpeng'
import time
class timeme(object):
__unitfactor = {'s': 1,
'ms': 1000,
'us': 1000000}
def __init__(self, unit='s', precision=4):

Typography

Headings

Headings from h1 through h6 are constructed with a # for each level:

# h1 Heading
## h2 Heading
### h3 Heading

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

#Some alias and functions from http://xmodulo.com/useful-bash-aliases-functions.html
alias ..='cd ..'
alias ...='cd ../..'
alias brc='source ~/.bashrc'
alias lsa='ls -al'
alias cl='clear'
alias tsp='date | pbcopy'
alias ipinfo="curl ifconfig.me && curl ifconfig.me/host"
#functions
@pengmeng
pengmeng / vim74_lua
Last active August 29, 2015 14:16 — forked from jdewit/vim74_lua
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get build-dep vim-gnome
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev mercurial libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo rm -rf /usr/local/share/vim
sudo rm /usr/bin/vim
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8