Skip to content

Instantly share code, notes, and snippets.

View gasparch's full-sized avatar

Gaspar Chilingarov gasparch

  • Munich
View GitHub Profile
@gasparch
gasparch / demo_test.exs
Created October 31, 2017 16:32
Elixir 1.6 regression
# goes into test/ directory
defmodule DemoTest do
use ExUnit.Case
use PropCheck
use PropCheck.StateM
doctest Demo
test "greets the world" do
assert Demo.hello() == :world
end
@gasparch
gasparch / .tmux.conf
Created September 8, 2017 18:29 — forked from tsl0922/.tmux.conf
vim style tmux config
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
set -g base-index 1
# Easy config reload
bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
# vi is good
@gasparch
gasparch / case_vs_mapsfind.esx
Created December 5, 2016 20:51
case %{} vs maps:find
defmodule CaseVsMapsFind do
use Benchfella
@hash Enum.zip(Enum.to_list(1..1000), Enum.to_list(1000..2000)) |> Enum.into(%{})
bench "case match present key" do
v = 100
case @hash do
%{^v => val} -> val
_ -> :error