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
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| # vim:ft=zsh ts=2 sw=2 sts=2 | |
| # | |
| # agnoster's Theme - https://gist.github.com/3712874 | |
| # A Powerline-inspired theme for ZSH | |
| # | |
| # # README | |
| # | |
| # In order for this theme to render correctly, you will need a | |
| # [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts). | |
| # Make sure you have a recent version: the code points that Powerline |
| package slick | |
| /** | |
| * This is some code extracted from TimeOut codebase, demonstrating: | |
| * - Use of tag typed to avoid mixing session of different DB | |
| * - The use of the Reader Monad to compose Actions together and defer the choice of async/sync computation | |
| * | |
| * I remove the part where we can say if our operation are read only or not (to use different connection), in order to | |
| * make things easier. | |
| **/ |
| description "Mesos Master" | |
| start on runlevel [2345] | |
| stop on starting rc RUNLEVEL=[016] | |
| respawn | |
| respawn limit 2 5 | |
| env MESOS_CONFIG="/etc/mesos/conf" | |
| env MESOS_HOME="/usr/local/lib" |
| #!/bin/bash | |
| java_binary_link="/usr/bin/java" | |
| java_library="libjvm.so" | |
| library_paths=( | |
| /jre/lib/amd64/server | |
| /jre/lib/amd64/client | |
| /usr/lib | |
| /lib |
| Backbone = require 'backbone' | |
| class Foo extends Backbone.Model | |
| set: -> super | |
| foo = new Foo | |
| foo.set x: 'x' | |
| console.log foo.get 'x' # x |
| # Rewrote excellent intro to Backbone.js http://arturadib.com/hello-backbonejs/ in CoffeeScript | |
| $ -> | |
| Backbone.sync = (method, model, success, error) -> | |
| success() | |
| class Item extends Backbone.Model | |
| defaults: | |
| part1: 'hello' | |
| part2: 'world' |
Some exercises from the Falsy Values workshops.
The good parts: