Version: 1.9.8
Platform: x86_64
First, install or update to the latest system software.
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
| defmodule Lists do | |
| @doc""" | |
| # Problem 5 | |
| Reverse a list. | |
| # Example in iex | |
| iex> Lists.reverse [] | |
| [] |
| defmodule HttpRequester do | |
| use GenServer.Behaviour | |
| def start_link(_) do | |
| :gen_server.start_link(__MODULE__, nil, []) | |
| end | |
| def fetch(server, url) do | |
| :gen_server.cast(server, {:fetch, url}) | |
| end |
| # This is an example of metaprogramming in the Elixir language. | |
| # | |
| # We will define a domain specific language (DSL) for the definition | |
| # of a service which is watched by several sensors. | |
| # Each sensor watches some property/functionality of the service and | |
| # returns the result of the check. | |
| # | |
| # To determine if the service is functioning properly, we need functions | |
| # to run all the sensors' code and gather the returned data. | |
| # |
| #!/usr/bin/env bash | |
| # Kill an Erlang process by node name | |
| # | |
| # e.g.: kill-erlang-node kred | |
| # Check usage | |
| if [ -z "$1" ]; then | |
| echo "Usage: `basename $0` NODE_NAME" | |
| exit 1 |
On the Refinery29 Mobile Web Team, codenamed "Bicycle", all of our unit tests are written using Jasmine, an awesome BDD library written by Pivotal Labs. We recently switched how we set up data for tests from declaring and assigning to closures, to assigning properties to each test case's this object, and we've seen some awesome benefits from doing such.
Up until recently, a typical unit test for us looked something like this:
describe('views.Card', function() {When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com, example2.com, and example1.com/images on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| # Based on https://github.com/sass/libsass/wiki/Building-with-autotools | |
| # Install dependencies | |
| apt-get install automake libtool | |
| # Fetch sources | |
| git clone https://github.com/sass/libsass.git | |
| git clone https://github.com/sass/sassc.git libsass/sassc | |
| # Create configure script |
| { | |
| // http://eslint.org/docs/rules/ | |
| "ecmaFeatures": { | |
| "binaryLiterals": false, // enable binary literals | |
| "blockBindings": false, // enable let and const (aka block bindings) | |
| "defaultParams": false, // enable default function parameters | |
| "forOf": false, // enable for-of loops | |
| "generators": false, // enable generators | |
| "objectLiteralComputedProperties": false, // enable computed object literal property names |