Skip to content

Instantly share code, notes, and snippets.

View rschenk's full-sized avatar
🐬
Space is the place

Ryan Schenk rschenk

🐬
Space is the place
View GitHub Profile
= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"
-# Local fallback for if/when Google decides to stop hosting jQuery
:javascript
!window.jQuery && document.write(unescape(#{URI::escape javascript_include_tag("jquery.1.6.2.min.js")}));
# 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\]"
@rschenk
rschenk / gist:1333846
Created November 2, 2011 15:00
Nodester NPM Not Working
$ nodester app create synynyms
nodester info creating app: synynyms server.js
nodester info successfully created app synynyms to will run on port 12398 from server.js
nodester info run nodester app init synynyms to setup this app.
$
$
$ nodester app info synynyms
nodester info Gathering information about: synynyms
nodester warn synynyms on port 12398 running: false (pid: unknown)
nodester info gitrepo: git@nodester.com:/node/git/rschenk/4245-08cf4fe1d8242013d68cca50d4f02eb5.git
require 'date'
d1 = Date.parse('Apr 1, 2011')
d2 = Date.parse('Feb 1, 2011')
if d2 > d1
p "#{d2} comes before #{d1}"
elsif d1 > d2
p "#{d1} comes before #{d2}"
else
@rschenk
rschenk / gist:1659828
Created January 23, 2012 01:23
Method for increasing wife's marital satisfaction
ssh family_computer
sudo su
su wife -c "osascript -e 'tell application \"iTunes\"' -e 'set the sound volume to 0' -e 'pause' -e 'end tell'"
afplay path/to/tom_waits.mp3
su wife -c "osascript -e 'tell application \"iTunes\"' -e 'set the sound volume to 100' -e 'play' -e 'end tell'"
exit
exit
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 );
if( (desiredInterval / [[timescaleIntervals objectAtIndex:(i-1)] doubleValue]) < ([[timescaleIntervals i] doubleValue] / desiredInterval) )
if desiredInterval / timescaleIntervals[i-1] < timescaleIntervals[i] / desiredInterval
@rschenk
rschenk / gist:3907556
Created October 17, 2012 19:22
Add git information to bash prompt
# 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\]"
@rschenk
rschenk / gist:3953569
Created October 25, 2012 15:50
Humanities Article Title Generator
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
Dir[Rails.root.join('app', 'models', 'mixins', '*.rb')].each do |filename|
require filename
end