Skip to content

Instantly share code, notes, and snippets.

michalmuskala / decode.txt
Last active Mar 16, 2021
Jason benches
View decode.txt
Operating System: macOS"
CPU Information: Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Number of Available Cores: 8
Available memory: 16 GB
Elixir 1.7.0-dev
Erlang 21.0
Benchmark suite executing with the following configuration:
warmup: 5 s
time: 30 s

Keybase proof

I hereby claim:

  • I am michalmuskala on github.
  • I am michalmuskala ( on keybase.
  • I have a public key ASD4xBbD3s6nedsVDfSRtGTLOa33wAWB18kagmvYs7ktago

To claim this, I am signing this object:


Erlang/Elixir syntax reference

This reference is aimed at allowing you to comfortably read erlang documentation and consume terms printed in Erlang format. It does not aim at allowing you to write Erlang code.

This is a modified version of

Data types

Erlang and Elixir have the same data types for the most part, but there are a number of differences.

View parser.hs
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Language.Brainfuck.Parser
import Control.Monad.Except
import Control.Monad.State
data ParseError = Unexpected Char
View downloader.exs
#!/usr/bin/env elixir
defmodule Committer do
defstruct [:name, :email]
def list(repo) do
|> from_repo
|> Stream.unfold(fn str ->
case String.split(str, "\n", parts: 2, trim: true) do
View fizzbuzz.ex
defmodule FizzBuzz do
def fizzbuzz(a) when rem(a, 3) == 0 and rem(a, 5) == 0, do: "FizzBuzz"
def fizzbuzz(a) when rem(a, 3) == 0, do: "Fizz"
def fizzbuzz(a) when rem(a, 5) == 0, do: "Buzz"
def fizzbuzz(a), do: a
1..100 |> |> Enum.each(&IO.puts/1)