Generate a new Elixir project using mix and add cowboy and plug as dependencies in mix.exs:
defp deps do
[
{:cowboy, "~> 1.0.0"},
{:plug, "~> 0.8.1"}
]
end| ▶ brew list -1 | while read line; do brew unlink $line; brew link $line; done | |
| Unlinking /usr/local/Cellar/appledoc/2.2... 0 links removed | |
| Linking /usr/local/Cellar/appledoc/2.2... 1 symlinks created | |
| Unlinking /usr/local/Cellar/autoconf/2.69... 0 links removed | |
| Linking /usr/local/Cellar/autoconf/2.69... 18 symlinks created | |
| Unlinking /usr/local/Cellar/bash-completion/1.3... 184 links removed | |
| Linking /usr/local/Cellar/bash-completion/1.3... 182 symlinks created | |
| Unlinking /usr/local/Cellar/bgrep/0.2... 0 links removed | |
| Linking /usr/local/Cellar/bgrep/0.2... 1 symlinks created | |
| Unlinking /usr/local/Cellar/binutils/2.24... 49 links removed |
| /** | |
| * Module that implements non-jQuery script injection with Deferred/Promise support (using | |
| * Q.js ). | |
| * | |
| * This deferred load notifies caller when the script is loaded... so chaining | |
| * or post load actions is easily supported. | |
| * | |
| */ | |
| ( function( win, doc, $q ){ | |
| "use strict"; |
| defmodule Expng do | |
| defstruct [:width, :height, :bit_depth, :color_type, :compression, :filter, :interlace, :chunks] | |
| def png_parse(<< | |
| 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, | |
| _length :: size(32), | |
| "IHDR", | |
| width :: size(32), | |
| height :: size(32), |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Ansi 0 Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.11759774386882782</real> |
Generate a new Elixir project using mix and add cowboy and plug as dependencies in mix.exs:
defp deps do
[
{:cowboy, "~> 1.0.0"},
{:plug, "~> 0.8.1"}
]
end| defmodule Map.Helpers do | |
| @moduledoc """ | |
| Functions to transform maps | |
| """ | |
| @doc """ | |
| Convert map string camelCase keys to underscore_keys | |
| """ | |
| def underscore_keys(nil), do: nil |
TIL how to make deprecation warnings:
Compiling 2 files (.ex)
warning: `Retort.Resources.timeout/2` is deprecated; call `Retort.Resources.Timeout.get_or_default/2` instead.
lib/retort/resources.ex:197: Retort.Resources.timeout/2
Function to be replaced
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
####Definition:
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |