- You can submit your work from yesterday and today here.
> Steve Kinney's Custom Quix Commands | |
> TITLE: kinney-quix.txt | |
> REMARKS: Based on Merlin Mann's and Roberto Mateu's Custom Quix Commands | |
> GITHUB: http://gist.github.com/376996 | |
> MORE: http://quixapp.com | |
> UPDATED: 2010-04-23_14-57-14 | |
@Custom Quix Commands | |
@May organize these better once they all stabilize | |
bit javascript:var%20e=document.createElement('script');e.setAttribute('language','javascript');e.setAttribute('src','http://bit.ly/bookmarklet/load.js');document.body.appendChild(e);void(0); Make a bit.ly link |
1.upto(100) do |x| | |
if x % 3 == 0 && x % 5 == 0 | |
puts "FizzBuzz" | |
elsif x % 3 == 0 | |
puts "Fizz" | |
elsif x % 5 == 0 | |
puts "Buzz" | |
else | |
puts x | |
end |
for (var i = 0; i <= 100; i++){ | |
if (i % 3 === 0 && i % 5 === 0) { | |
document.write("FizzBuzz") | |
} else if (i % 3 === 0) { | |
document.write("Fizz") | |
} else if (i % 5 === 0) { | |
document.write("Buzz") | |
} else { | |
document.write(i) | |
} |
function convertFahrenheitToCelsius(temperature) { | |
// Take whatever temperature the function is handed, do some math and return it. | |
return (temperature - 32) * (5/9) | |
} | |
// Prompt the user and store whatever they say in a variable. | |
var theirInput = prompt("Enter in a Fahrenheit temperature & I'll convert it to Celsius"); | |
// Run their number through the function and store it in a variable named result. | |
var result = convertFahrenheitToCelsius(theirInput); |
set nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
Bundle 'gmarik/vundle' | |
" My Bundles | |
Bundle 'stevekinney/snipmate.vim' |
[NPM][npm] is one of the best features of the Node.js ecosystem. It's like someone went in an fixed everything that annoyed me about RubyGems.
Nodejitsu published some awesome cheat sheets for NPM and package.json
that I refer to often.
It's probably worth skimming through Max Ogden's [Art of Node][art]. There is also a series of interactive tutorials—kind of like "Try Ruby" that you can download and install at [Nodeschool.io][nodeschool].
Since you're coming from a Ruby background, you might want to check out [Express][], [Jade][], and [Stylus][]. I'm primarily recommending these three libraries because they are inspired by Sinatra, HAML, and SASS respectively. Playing around with Express is a good way to leverage your familiarity with Sinatra as you get the hang of some of the different patterns in Node.
var express = require('express'), | |
var passport = require('passport'); | |
var TwitterStrategy = require('passport-twitter').Strategy; | |
var ensureLoggedIn = require('connect-ensure-login').ensureLoggedIn; | |
var app = express(); | |
// Set these variables in your environment. | |
var SESSION_SECRET = process.env.SESSION_SECRET; | |
var TWITTER_CONSUMER_KEY = process.env.TWITTER_CONSUMER_KEY; | |
var TWITTER_CONSUMER_SECRET = process.env.TWITTER_CONSUMER_SECRET; |