This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd ~ | |
| git clone git://github.com/sstephenson/rbenv.git .rbenv | |
| echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc | |
| echo 'eval "$(rbenv init -)"' >> ~/.zshrc | |
| exec $SHELL | |
| mkdir -p ~/.rbenv/plugins | |
| cd ~/.rbenv/plugins | |
| git clone git://github.com/sstephenson/ruby-build.git | |
| rbenv install 1.9.3-p194 | |
| rbenv rehash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| express = require 'express' | |
| app = module.exports = express.createServer() | |
| # redirect to a non-www domain | |
| app.get '/*', (req, res, next) -> | |
| if req.headers.host.match(/^www\./)? | |
| res.redirect 'http://' + req.headers.host[4..] + req.url, 301 | |
| else next() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var connect = require('connect'); | |
| var server = connect.createServer(); | |
| // Middleware | |
| server.use(connect.logger()); | |
| server.use(connect.static(__dirname + '/public')); | |
| // Routes | |
| server.use(connect.router(function(app) { | |
| app.get('/', function(req, res) { |