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
| defmodule KV.GenServer do | |
| use GenServer | |
| def start_link(opts), do: GenServer.start_link(__MODULE__, :ok, opts) | |
| def lookup(server, name), do: GenServer.call(server, {:lookup, name}) | |
| def create(server, name, value), do: GenServer.cast(server, {:create, name, value}) | |
| def init(:ok), do: {:ok, %{}} |
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
| /** | |
| * Inspired by AngularJS' implementation of "click dblclick mousedown..." | |
| * | |
| * This ties in the Hammer events to attributes like: | |
| * | |
| * hm-tap="add_something()" | |
| * hm-swipe="remove_something()" | |
| * | |
| * and also has support for Hammer options with: | |
| * |
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
| # The install script | |
| # Adapted from https://gist.github.com/579814 | |
| echo '# Added by install script for node.js and npm in 30s' >> ~/.bashrc | |
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| echo 'export NODE_PATH=$HOME/local/lib/node_modules' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir -p ~/local | |
| mkdir -p ~/Downloads/node-latest-install |