Skip to content

Instantly share code, notes, and snippets.

@dsosby
dsosby / gist:2160486
Created March 22, 2012 17:33
JS Logging
var loglevel = 3;
function debug(message, level) {
level = level || 1;
if ( console ) {
if ( level >= loglevel ) {
console.log(message);
}
}
}
@dsosby
dsosby / gist:1754623
Created February 6, 2012 20:28
Patterns
public class Foo {
boolean a;
int b;
public Foo() {
a = true;
b = 42;
}
}
@dsosby
dsosby / vimrc.vim
Created September 14, 2011 16:40
Windows vimrc
if has('gui_running')
set guioptions-=T " no toolbar
colorscheme obsidian2
endif
set ic "Ignore case when searching
set number
set nocompatible "No to VI compatible mode
set backup "Make backup files
set mouse=a
@dsosby
dsosby / obsidian2.vim
Created September 14, 2011 16:26
My Obsidian2.vim color scheme
" Vim color file
" Maintainer: Daniel Bolton <danielbarrettbolton@gmail.com>
" Last Modified: 2010-07-04
" Version: 0.1
"
" This scheme is based on the excellent lucius scheme. The cfterm colors are
" in fact exactly the same, and exist simply because I was too lazy to remove
" them yet.
set background=dark
import sys
import re
import string
import urllib
filename = "".join(sys.argv[1:])
if filename.startswith("http"):
htmlFile = urllib.urlopen(filename)
else:
htmlFile = open(filename, 'r')