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
#!/usr/bin/env node | |
CHANNEL = '#bozler' | |
MINIMUM_HUMAN_REACTION = 2 | |
DIALOGUE = | |
ACTIONS_IN_REPLY: [ | |
"I vote for pizza", | |
"Disregard that, I vote for pizza", | |
"Another vote for pizza!" |
/** | |
* Read Linux mouse(s) in node.js | |
* Author: Marc Loehe (marcloehe@gmail.com) | |
* | |
* Adapted from Tim Caswell's nice solution to read a linux joystick | |
* http://nodebits.org/linux-joystick | |
* https://github.com/nodebits/linux-joystick | |
*/ | |
var fs = require('fs'), |
Some exercises from the Falsy Values workshops.
The good parts:
iex> i 'hello'
Term
I started with Elixir just a couple weeks after the switch from 1.4 to 1.5, so the bulk of online resources were out of date (or at least resulted in deprecation warnings). This guide is for defining Elixir 1.5 supervised modules.
It's not actually terribly complicated. It's just sometimes unclear from examples what's implemented by the language and what you actually have to implement yourself.
Say we want a supervision tree like this (where each atom is a process):
:a
/ \
defmodule Game do | |
use GenServer | |
def init(game_id) do | |
{:ok, %{game_id: game_id}} | |
end | |
def start_link(game_id) do | |
GenServer.start_link(__MODULE__, game_id, name: {:global, "game:#{game_id}"}) | |
end |