Skip to content

Instantly share code, notes, and snippets.

View benwyrosdick's full-sized avatar

Ben Wyrosdick benwyrosdick

View GitHub Profile
class Sudoku
attr_accessor :board
Possibilities = (1..9).to_a
def initialize(board_in = nil)
self.board = []
9.times do # rows
row = []
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ [\1]/'
}
function count_git_changes {
git ls-files -m -o -d --exclude-standard 2> /dev/null | grep \w* -c | sed -e 's/\([0-9]*\)/ \1/g' -e '/^ 0/d'
}
function proml {
local BLUE="\[\033[0;34m\]"
if exists('g:loaded_pathogen')
call pathogen#runtime_prepend_subdirectories(expand('~/.vim/bundles'))
end
syntax on
filetype plugin indent on
augroup vimrc
autocmd GuiEnter * set guioptions-=T columns=150 lines=70
augroup END
[color]
diff = auto
status = auto
branch = auto
[user]
name = Ben Wyrosdick
email = [email protected]
[alias]
st = status
co = checkout
@benwyrosdick
benwyrosdick / grep_edit
Created July 14, 2009 14:44
grep_edit script
#!/bin/sh
#grep_edit some_pattern [some_path]
#
#the path is optional ... for help with git grep command type:
#git help grep
git grep $1 $2 | cut -f1 -d: | uniq | xargs mvim
config = URI.parse(ENV['MONGO_URL'] || 'mongodb://localhost:27017/thedb')
MongoMapper.connection = Mongo::Connection.new(config.host, config.port)
MongoMapper.database = config.path.gsub(/^\//, '')
MongoMapper.database.authenticate(config.user, config.password) if config.user
@benwyrosdick
benwyrosdick / twitter_pic
Created March 11, 2010 04:43
Take a snapshot with iSight and upload it to twitter as you profile picture
#!/bin/sh
#
# download isightcapture at link below
# http://www.intergalactic.de/pages/iSight_files/isightcapture1_1.dmg
isightcapture -t png /tmp/capture.png
curl -u user:pass -H 'Expect:' -F image=@'/tmp/capture.png;type=image/png' http://api.twitter.com/1/account/update_profile_image.xml > /dev/null
echo "Profile Pic Updated"
@benwyrosdick
benwyrosdick / gist:2410135
Created April 18, 2012 00:39
Resize all my main apps for either laptop or cinema display mode
set leftArrow to 123
set rightArrow to 124
set upArrow to 126
set downArrow to 125
set halfScreen to {control down, option down, command down}
set quarterScreen to {shift down, control down, option down}
tell application "Finder" to set screenSize to bounds of window of desktop
set width to item 3 of screenSize
@benwyrosdick
benwyrosdick / gist:11270837
Created April 24, 2014 21:52
Burlingame / San Mateo Links
-- Ingress Map Analyser --
Portals: 215
Links: 628
0. "Leon"
0.0 Central Park Japanese Garden
0.1 For All the People
0.2 Graffiti Mural
0.3 Japanese Garden Ancient Tower Statue
-- Ingress Map Analyser --
Portals: 384
Links: 1136
0. 3536 Shelby Fountain
0.0 Concord Baptist Church
0.1 North Shelby Fountain
0.2 Shelby Fountain
0.3 Zapopan Authentic Mexican