View Dockerfile
FROM elixir:1.5.1
RUN mkdir /app
WORKDIR /app
EXPOSE 7777
ENV PORT=7777
ENV MIX_ENV=prod
RUN mix local.hex --force && mix local.rebar --force
View Elixir on Debian Testing.md

Install Erlang Dependencies

Note: This assumes you are using GTK, if not, choose a different version of the libwx or you'll end up installing all of GTK. If you aren't using a window manager, you don't need WX at all, but you'll miss out on some cool built in GUIs.

sudo apt-get install build-essential libncurses5-dev libssl-dev libwxgtk3.0-dev

Download and compile Erlang

View reverse_polish_notation.ex
defmodule Polish do
defmacro reverse_polish_notation(code) do
code
|> do_reverse_polish()
|> List.flatten()
|> Enum.join(" ")
end
defmacro sigil_p({:<<>>, _, [code]}, '') do
build_code(code)
View pg_index_utilization.sql
SELECT idstat.relname AS table_name,
indexrelname AS index_name,
CASE WHEN indexdef ~* 'unique' THEN 'UNIQUE' END,
pg_size_pretty(pg_relation_size(indexrelname::text)) AS index_size,
idstat.idx_scan AS times_used,
n_tup_upd + n_tup_ins + n_tup_del as num_writes,
indexdef
FROM pg_stat_user_indexes AS idstat JOIN pg_indexes ON indexrelname = indexname
JOIN pg_stat_user_tables AS tabstat ON idstat.relname = tabstat.relname
ORDER BY num_writes desc, times_used ASC;
View 0-problem.md

For some reason, I can't seem to serve more than a bit under 2^14 tcp requests without elixer hanging.

This happens consistently in multiple projects I have set up. Below is a boiled down version that exhibits the behavior.

View gist.rb
class Test
include Enumerable
def each
yield "Hello"
yield "World"
end
end
enum = Test.new
array = ["Hello", "World"]
View railsconf_schedule.rb
$("<script/>", {type: "text/javascript", src: "https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"}).appendTo(document.body);
$(".session-content a").on("click", function() { event.stopPropagation(); });
$(".session-content").on("click", function() {
var session = $(this),
title = session.find(".session-title"),
details = title.find("a")[0].href,
speaker = session.find(".speaker-name"),
room = $("th").eq(session.parent().index()),
text = function(el) { return el.text().trim(); },
View outlook_proxy.rb
require 'openssl'
require 'socket'
Thread.abort_on_exception = true
server = TCPServer.new(1993)
n = 0
loop do
client = server.accept
n += 1
View 0_enumerator.rb
class Benerator
def initialize(&block)
@block = block
end
def next
as_array.shift
end
def as_array
View alias.rb
class Parent
def foo
"Parent#foo"
end
alias :bar :foo
end
class Child < Parent
def foo
"Child#foo"