Skip to content

Instantly share code, notes, and snippets.

Avatar
🐬
Space is the place

Ryan Schenk rschenk

🐬
Space is the place
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am rschenk on github.
  • I am rschenk (https://keybase.io/rschenk) on keybase.
  • I have a public key ASDs3H75m_NpydNPNMySAoLI3Bd_45hDd-EbKyFPMBuGhQo

To claim this, I am signing this object:

View gist:4259431
class JackieTreehorn {
public Woman treat(Object obj) {
return (Woman)obj;
}
}
View gist:4157226
describe "#geocode_unless_on_base" do
context 'when off base' do
context 'with a geocodable address' do...
context 'with a non-geocodable address' do...
context 'with a blank physical_location' do...
context 'with buck shot eyes and a purple heart' do
it('rolls down the national stroll') {}
end
...
View gist:4080065
# Change Terminal Themes
function tabc {
NAME=$1; if [ -z "$NAME" ]; then NAME="Default"; fi
osascript -e "tell application \"Terminal\" to set current settings of front window to settings set \"$NAME\"" > /dev/null 2>&1
}
# Change Terminal Themes When you SSH
function ssh {
tabc "IR_Black_Remote"
View gist:4080048
function newtab {
osascript -e "
tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down
tell application \"Terminal\" to do script \"cd \\\"$(PWD)\\\"\" in selected tab of the front window
" > /dev/null 2>&1
}
View env.rb
Dir[Rails.root.join('app', 'models', 'mixins', '*.rb')].each do |filename|
require filename
end
@rschenk
rschenk / gist:3953569
Created Oct 25, 2012
Humanities Article Title Generator
View gist:3953569
adjectives = %w(Modern Global Discursive Rural Representational Credit Affective Domestic Transnational Nuclear Colonial Saharan Queer Fordist Contemporary Socialist Socioeconomic Marxist Buddhist Kinky Forgotten Ghandian Conservative)
prefixes = %w(Pre Post Meta Neo Sub Multi Self Trans)
locations = ["Empire", "United States", "South America", "New Europe", "Chile", "Diaspora", "Worlds", "State", "India", "China", "Labor Camps", "Margin", "Tibet", "Urban Space", "Cyberspace", "Africa", "Bollywood", "Wall Street", "Truth", "Fear", "Violence", "Corporations"]
nouns = ["The Gaze", "Survival", "Privatization", "Commodity", "Conservation", "Mediation", "Protest", "Sovereignty", "Narrative", "Stiob", "Communication", "Materiality", "Faciality", "Territorialization", "New Media", "Industrialism", "Machine", "Ethnography", "Dialectic", "Cyborg", "Anthropology", "Economy", "Philanthropy", "Sexuality", "Life", "Democracy", "Personhood", "Revival", "Culture"]
adjective_phrase = {
:a => adjectives,
:b => [prefixes
@rschenk
rschenk / gist:3907556
Created Oct 17, 2012
Add git information to bash prompt
View gist:3907556
# Bedazzle terminal with Git branch information
NO_COLOR="\[\033[0m\]"
BLACK="\[\033[0;30m\]"
RED="\[\033[0;31m\]"
GREEN="\[\033[0;32m\]"
YELLOW="\[\033[0;33m\]"
BLUE="\[\033[0;34m\]"
PURPLE="\[\033[0;35m\]"
CYAN="\[\033[0;36m\]"
GRAY="\[\033[0;90m\]"
View gist:2629488
if( (desiredInterval / [[timescaleIntervals objectAtIndex:(i-1)] doubleValue]) < ([[timescaleIntervals i] doubleValue] / desiredInterval) )
if desiredInterval / timescaleIntervals[i-1] < timescaleIntervals[i] / desiredInterval
View gist:2142388
function get_gni_data( options ) {
alert( options.search_term );
alert( options.add_register_link );
// defaults are annoying. You could do something like this:
options.search_term = options.search_term || "some default";
// OR if you're using a library like Underscore, you could do
options = _({ search_term: "default_value", add_regsiter_link: 1}).extend( options );