Skip to content

Instantly share code, notes, and snippets.

View soopercorp's full-sized avatar
🚲

hardy soopercorp

🚲
View GitHub Profile
@soopercorp
soopercorp / gist:752662
Created December 23, 2010 06:38 — forked from defunkt/gist:6443
Talk by Chris Wanstrath
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
keynote-y.
@soopercorp
soopercorp / show
Created April 20, 2011 20:49 — forked from tekacs/show
# Usage: show <local-port> <subdomain>
function show() {
DOMAIN=".tekacs.com"
REMOTE="$2$DOMAIN"
ssh -tR 1080:127.0.0.1:$1 vps "sudo ssh -Nl \$USER -L $REMOTE:80:127.0.0.1:1080 localhost"
}
@soopercorp
soopercorp / gsd.sh
Created May 5, 2011 05:05 — forked from jcromartie/gsd.sh
Elegant Bash-based Get-Shit-Done script
#!/usr/bin/env bash
# edit this list, or set GSD_SITES to add your custom sites
SITES="$GSD_SITES reddit.com forums.somethingawful.com somethingawful.com digg.com break.com news.ycombinator.com infoq.com bebo.com twitter.com facebook.com blip.com youtube.com vimeo.com delicious.com flickr.com friendster.com hi5.com linkedin.com livejournal.com meetup.com myspace.com plurk.com stickam.com stumbleupon.com yelp.com slashdot.com"
HOSTFILE="/etc/hosts"
if [ ! -w $HOSTFILE ]
then
echo "cannot write to $HOSTFILE, try running with sudo"
@soopercorp
soopercorp / nodeconf_2011.md
Created May 9, 2011 09:42 — forked from mattpodwysocki/nodeconf_2011.md
a list of slides from nodeconf 2011
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@soopercorp
soopercorp / nodecamp.eu-talks-2011.md
Created June 14, 2011 10:17 — forked from a2800276/nodecamp.eu-talks-2011.md
A collection of talks and presentations held at nodecamp.eu 2011
@soopercorp
soopercorp / swype.py
Created February 23, 2012 05:41 — forked from krisys/swype.py
How swype works?
WORDS = open('wordlist.txt').read().split()
KEYBRD_LAYOUT = ['qwertyuiop', 'asdfghjkl', 'zxcvbnm']
def match(path, word):
""" Checks if a word is present in a path or not. """
try:
for char in word:
path = path.split(char, 1)[1]
return True
@soopercorp
soopercorp / sc-dl.js
Created March 5, 2012 21:33 — forked from pheuter/sc-dl.js
Bookmarklet that generates download link for a Soundcloud upload
(function(d) {
var dl = d.createElement('a');
dl.innerText = 'Download MP3';
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1];
dl.download = d.querySelector('em').innerText+".mp3";
d.querySelector('.primary').appendChild(dl);
dl.style.marginLeft = '10px';
dl.style.color = 'red';
dl.style.fontWeight = 700;
})(document);
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal