Some exercises from the Falsy Values workshops.
The good parts:
- HTTP server and client in same script
- Express cookies example
- Express routing example
- Express error handling
- Express middlewares example
- Simple HTTP proxy
Some exercises from the Falsy Values workshops.
The good parts:
Some exercises from the Falsy Values workshops.
The good parts:
# load libraries | |
require 'coffee-script' | |
mongoose = require 'mongoose' | |
express = require 'express' | |
step = require "step" | |
# about oauth | |
OAuth = require('oauth').OAuth | |
oauth = new OAuth( | |
'https://api.twitter.com/oauth/request_token', |
# load libraries | |
require 'coffee-script' | |
mongoose = require 'mongoose' | |
express = require 'express' | |
step = require "step" | |
# about oauth | |
OAuth = require('oauth').OAuth | |
oauth = new OAuth( | |
'https://api.twitter.com/oauth/request_token', |
### | |
Module dependencies | |
### | |
require.paths.unshift "#{__dirname}/lib/support/express-csrf/" | |
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/" | |
express = require 'express' | |
app = module.exports = express.createServer() | |
RedisStore = require 'connect-redis' |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Flexbox Layout</title> | |
<style> | |
article { | |
border: 1px solid red; | |
display: -webkit-box; | |
display: -moz-box; | |
display: box; |
class window.GoogleChart | |
constructor: -> | |
@width = 0 | |
@height = 0 | |
@encoded = [] | |
@data = [] | |
simpleEncoding: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' | |
extendedMap: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.', |
run ->(e){ p=Hash[*e['QUERY_STRING'].split(/[&=]/)]; [200, {'Content-type'=>'text/html'}, ["Hello #{p['name']}!"]] } |
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl http://npmjs.org/install.sh | sh |