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
@dsosby
dsosby / config-highlight.cfg
Created Aug 3, 2011
A dark highlighting theme for Python's IDLE IDE based on Notepad++'s Obsidian color scheme
View config-highlight.cfg
[Obsidian]
definition-foreground = #678CB1
error-foreground = #FF0000
string-background = #293134
keyword-foreground = #93C763
normal-foreground = #E0E2E4
comment-background = #293134
hit-foreground = #E0E2E4
builtin-background = #293134
stdout-foreground = #678CB1
View gist:1163805
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')
@dsosby
dsosby / obsidian2.vim
Created Sep 14, 2011
My Obsidian2.vim color scheme
View obsidian2.vim
" 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
@dsosby
dsosby / vimrc.vim
Created Sep 14, 2011
Windows vimrc
View vimrc.vim
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
View gist:1754623
public class Foo {
boolean a;
int b;
public Foo() {
a = true;
b = 42;
}
}
@dsosby
dsosby / gist:1823881
Created Feb 14, 2012
Jsonp & Clojurescript
View gist:1823881
(def tumblr-url "http://pipes.yahoo.com/pipes/pipe.run?_id=4ddef10340ec6ec0374cbd0f73bce819&_render=json")
(defn display-count [json-obj]
(let [data (js->clj json-obj :keywordize-keys true)
post-count (:count data)]
(js/alert (str "Number of posts: " post-count))))
(defn display-items [json-obj]
(let [data (js->clj json-obj :keywordize-keys true)
items (:items (:value data))
View gist:2160486
var loglevel = 3;
function debug(message, level) {
level = level || 1;
if ( console ) {
if ( level >= loglevel ) {
console.log(message);
}
}
}
@dsosby
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
endif
@dsosby
dsosby / .taskrc
Created Jun 19, 2012
My TaskWarrior RC file
View .taskrc
# [Created by task 2.0.0 6/5/2012 10:23:30]
# Taskwarrior program configuration file.
# For more documentation, see http://taskwarrior.org or try 'man task', 'man task-faq',
# 'man task-tutorial', 'man task-color', 'man task-sync' or 'man taskrc'
# Here is an example of entries that use the default, override and blank values
# variable=foo -- By specifying a value, this overrides the default
# variable= -- By specifying no value, this means no default
# #variable=foo -- By commenting out the line, or deleting it, this uses the default
View gist:3123580
boolean isFoo() {
int status = this.getStatus();
return (status != STATUS_BAR &&
status != STATUS_BAZ);
}
vs.
boolean isFoo() {
You can’t perform that action at this time.