Skip to content

Instantly share code, notes, and snippets.

@billyvg
billyvg / .vimrc
Created January 3, 2011 17:48
My vimrc file
set nocompatible " No vi support
set nobackup " Don't create backups
set mouse=a " Enable mouse support
set confirm " Fuck if I know
set ruler " Show cursor position
set number " Show line numbers
set showcmd " Show (partial) command in status line
set wildmenu " Show wild menu
set wildmode=list:longest
set nocompatible
set number
set ruler
syntax on
" Set encoding
set encoding=utf-8
" Whitespace stuff
@billyvg
billyvg / .bash_prompt
Created June 3, 2011 19:31
my bash prompt
#### requires vcprompt ---- http://vc.gerg.ca/hg/vcprompt/archive/tip.tar.gz #####
#### PS1 customization ####
twolevelprompt='$([ "$PWD" != "${PWD%/*/*/*}" ] && echo "...${PWD##${PWD%/*/*}}" || echo "$PWD")'
NONE="\[\033[0m\]" # unsets color to term fg color
# regular colors
K="\[\033[0;30m\]" # black
R="\[\033[0;31m\]" # red
G="\[\033[0;32m\]" # green
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set history=1000
set foldmethod=marker
set hidden
set backspace=indent,eol,start " Allow backspacing over everything in insert mode
set showcmd " Show (partial) command in status line
set autowrite " Automatically save before commands like :next and :make
def challenge(number):
begin, end = divmod(number, 100)
middle = (number % 1000) / 10
return (begin + end) == middle
for x in xrange(1000, 9999):
if challenge(x):
print x
/**
* Any anals should be done here.
*
*/
$(function() {
(function(anal) {
$('.follow').on('click', function(e) {
anal.push(['_trackEvent', 'Rightrail', 'follow_' + $(this).data('type') + '_link', $(this).data('id')]);
});
# bindings
unbind C-b
unbind %
set -g prefix C-a
bind-key C-a last-window
bind-key R source-file ~/.tmux.conf
# pane bindings
bind \ split-window -h
bind - split-window -v
@billyvg
billyvg / maximum_battery_life.md
Created March 20, 2012 05:06 — forked from mrflip/maximum_battery_life.md
maximum battery life checklist -- use before a long plane flight

Max Battery Life Checklist

Here is a checklist to follow if you want maximum battery life -- for instance if you're about to get on a long plane flight.

10 hour battery life on a non-SSD Macbook Pro 17"

Low power use checklist

With power connected:

@billyvg
billyvg / .tmux.conf
Created March 29, 2012 23:01
Tmux conf
set-option -g default-command "reattach-to-user-namespace -l zsh"
# bindings
unbind C-b
unbind %
set -g prefix C-a
bind-key C-a last-window
bind-key R source-file ~/.tmux.conf
# pane bindings
'''Searches wikipedia and returns first sentence of article
Scaevolus 2009'''
import re
from util import hook, http
api_prefix = "http://wiki.guildwars2.com/api.php"
search_url = api_prefix + "?action=opensearch&format=xml"