a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!
| # 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. | |
| # 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" | |
| } |
| #!/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" |
a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!
| // ---------------------------------------------------------- | |
| // 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) {} |
##Using libuv and http-parser to build a webserver
Ryan Dahl, @ryah
Talk as a screencast: http://vimeo.com/24713213
Source, Part I: http://t.co/utoIM93
Source, Part II: http://bit.ly/iBgnIA
##Node.js on windows
Bert Belder
http://2bs.nl/nodecamp.pdf
| 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 |
| (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 |