Skip to content

Instantly share code, notes, and snippets.

David Sosby dsosby

Block or report user

Report or block dsosby

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:1163805
import sys
import re
import string
import urllib
filename = "".join(sys.argv[1:])
if filename.startswith("http"):
htmlFile = urllib.urlopen(filename)
htmlFile = open(filename, 'r')
dsosby / obsidian2.vim
Created Sep 14, 2011
My Obsidian2.vim color scheme
View obsidian2.vim
" Vim color file
" Maintainer: Daniel Bolton <>
" 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
dsosby / vimrc.vim
Created Sep 14, 2011
Windows vimrc
View vimrc.vim
if has('gui_running')
set guioptions-=T " no toolbar
colorscheme obsidian2
set ic "Ignore case when searching
set number
set nocompatible "No to VI compatible mode
set backup "Make backup files
set mouse=a
View gist:1754623
public class Foo {
boolean a;
int b;
public Foo() {
a = true;
b = 42;
View gist:2160486
var loglevel = 3;
function debug(message, level) {
level = level || 1;
if ( console ) {
if ( level >= loglevel ) {
dsosby / gist:2255328
Created Mar 30, 2012
vimrc for work pc (win)
View gist:2255328
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
"behave mswin
if has('gui_running')
set guioptions-=T " no toolbar
colorscheme obsidian2
View gist:3123580
boolean isFoo() {
int status = this.getStatus();
return (status != STATUS_BAR &&
status != STATUS_BAZ);
boolean isFoo() {
dsosby / gist:3744784
Created Sep 18, 2012
ClojureScript Goodies
View gist:3744784
;Get all methods/properties of some object
(goog.object/getKeys some-object)
;Getting undefined errors? Use undefined? to probe
(undefined? load-namespace)
(undefined? str)
View gist:3756552
(defn make-param-str [param-map]
(join "&" (map (fn [[key val]] (format "%s=%s" (name key) val)) param-map)))
;TODO still needs URL encoding -- format wont work in clojurescript
View PairSwap.c
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
typedef struct Node {
int data;
struct Node *next;
struct Node *prev;
} Node;
You can’t perform that action at this time.