Skip to content

Instantly share code, notes, and snippets.

View natlownes's full-sized avatar

Nat Lownes natlownes

View GitHub Profile
require 'rubygems'
require 'rest-client'
require 'json'
#
# get all users in a program
#
client_id = 1069416700
client_api_key = 'b26420242ff0a48b192ddc4fa3e4ac96'
# tiny success: http://bit.ly/RhpepU
# osx specific, mpg123 or the like for linux
nmap HH :silent ! afplay /Users/nat/.vim/audio/succ_horns01.mp3 1>&-2>&-&<CR><C-l>
require 'open-uri'
open("http://icanhazip.com/").read.strip
setopt No_X_Trace;
setopt No_Verbose;
if ! type redisplay 2>/dev/null 1>/dev/null; then
declare -x PS1
declare -x PS2;
declare -x PS3;
declare -x PS4;
setopt Prompt_Percent
@natlownes
natlownes / gist:1405105
Created November 29, 2011 15:04
non-fancy looking dock
defaults write com.apple.dock no-glass -boolean YES; killall Dock
@natlownes
natlownes / matchers.rb
Created November 29, 2011 15:03
javascript alert box rspec matcher for selenium
Spec::Matchers.define :be_displaying_alert do
match do |actual|
class_name = begin
actual.driver.browser.switch_to.alert.class
rescue => exception
exception.class
end
class_name == Selenium::WebDriver::Alert
end
@natlownes
natlownes / christ.txt
Created November 9, 2011 19:15
git pre-receive hook to catch Ruby debugger statements and reject push
.======.
| INRI |
| |
| |
.========' '========.
| _ xxxx _ |
| /_;-.__ / _\ _.-;_\ |
| `-._`'`_/'`.-' |
'========.`\ /`========'
@natlownes
natlownes / gist:1151730
Created August 17, 2011 15:11
git merge cheatsheet. I can never remember the fuck these are.
$LOCAL is set to the name of a temporary file containing the contents of the file on the current branch
$REMOTE set to the name of a temporary file containing the contents of the file to be merged
$BASE set to the name of a temporary file containing the common base for the merge.
" vimrc to allow for blasting off reggaeton horns while coding
nmap HH :silent execute "!afplay $HOME/.vim/audio/air_horn5.mp3 &>/dev/null & redraw!"<CR>
# git pre-receive hook for rejecting ruby code with debugger statements
#!/usr/bin/env ruby
def msg(message)
%{
#############################################################
#{message}
#############################################################
}