This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ruby script to download a file from the command line given a url | |
# | |
#works with two arguments: | |
#argument 1 is the path to the file, you can leave | |
#the http on or remove it, the script handles both | |
# | |
#second argument is the name of the file as you want it to be saved on disk | |
#i.e. download.zip | |
# | |
#KNOWN BUG: will not work given an IP instead of a url |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Adam Coffman | |
;; Scheme Assignment 2 | |
;; Jugs Problem | |
;;Program to solve the "Jugs Problem" from die hard 3. | |
;;invoked with (Jugs CapacityJugA CapacityJugB GoalFillofA) | |
;;returns a step by step path to the goal. | |
;;IE (Jugs 5 3 4) would return | |
;;((0 0 5 3) (5 0 5 3) (2 3 5 3) (2 0 5 3) (0 2 5 3) (5 2 5 3) (4 3 5 3)) | |
;;Suporting Functions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Adam Coffman | |
;; Scheme assignment 3 | |
;; The PARSE function accepts as argument an infix arithmetic expression in the | |
;; form of a list and returns a list representation of the corresponding expresion | |
;; tree. Ex., (parse '(3 + 4))--> (+ (3 4)), | |
;; (parse '(3 + 4 * 5)) --> (+ (3 (* (4 5)))) and | |
;; (parse '( 4 + 3 * ( 5 + 6) - 2)) --> (- ((+ (4 (* (3 (+ (5 6)))))) 2)) | |
;; Note that each element of the list must be one of three things: a number; one of +, -, * | |
;; /; or a sublist (ex., (5 + 6)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
" have command-line completion <Tab> (for filenames, help topics, option names) | |
" first list the available options and complete the longest common part, then | |
" have further <Tab>s cycle through the possibilities: | |
set wildmode=list:longest,full | |
" display the current mode and partially-typed commands in the status line: | |
set showmode | |
set showcmd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
" have command-line completion <Tab> (for filenames, help topics, option names) | |
" first list the available options and complete the longest common part, then | |
" have further <Tab>s cycle through the possibilities: | |
set wildmode=list:longest,full | |
" display the current mode and partially-typed commands in the status line: | |
set showmode | |
set showcmd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let g:peepopen_loaded = 1 | |
let g:peepopen_cwd = getcwd() | |
let s:save_cpo = &cpo | |
set cpo&vim | |
function s:LaunchPeepOpenViaVim() | |
let cwd = g:peepopen_cwd | |
silent exe "!open -a PeepOpen " . shellescape(cwd) | |
endfunction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switching to jekyll | |
basic nodejs app using express | |
using socketio with nodejs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim color file | |
" Converted from Textmate theme Bespin using Coloration v0.2.5 (http://github.com/sickill/coloration) | |
set background=dark | |
highlight clear | |
if exists("syntax_on") | |
syntax reset | |
endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Memoization { | |
public static Func<T,K> MemoizeFunction<T, K>(this Func<T, K> function) { | |
var table = new Dictionary<T, K>(); | |
return (args) => { | |
if (table.ContainsKey(args)) return table[args]; | |
var result = function(args); | |
table[args] = result; | |
return result; | |
}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#prompt | |
function parse_git_deleted { | |
[[ $(git status 2> /dev/null | grep deleted:) != "" ]] && echo "-" | |
} | |
function parse_git_added { | |
[[ $(git status 2> /dev/null | grep "Untracked files:") != "" ]] && echo '+' | |
} | |
function parse_git_modified { | |
[[ $(git status 2> /dev/null | grep modified:) != "" ]] && echo "*" | |
} |
OlderNewer