Skip to content

Instantly share code, notes, and snippets.

defmodule BrainfuckTest do
use ExUnit.Case
import BF
@doc "
BF is our Brainfuck turing machine
Output will be a map
%{
tape: map #our tape, in the format %{0=> 0, 1=> 0, 2=> 0 ...}
ptr: int, #pointer position

Benchmarking Phoenix vs Rails vs Sinatra vs Express vs Martini...

I was curious about [Chris McCord's Phoenix vs Rails article][original] -- if you haven't read it, go do that now first. Go ahead, this will still be here when you get back. It won't make much sense unless you've read the original.

Like many other Elixir enthusiasts, I come from a Ruby background. That said, I found Rails to be a curious choice for comparison to Phoenix, since Rails is really a kitchen-sink framework meant to handle everything from database migrations to asset-pipeline compilation. Sinatra, on the other hand, is a more

@omnibs
omnibs / phoenix showdown rackspace onmetal io.md
Last active January 25, 2023 18:33
Phoenix Showdown Comparative Benchmarks @ Rackspace

Comparative Benchmark Numbers @ Rackspace

I've taken the benchmarks from Matthew Rothenberg's phoenix-showdown, updated Phoenix to 0.13.1 and ran the tests on the most powerful machines available at Rackspace.

Results

Framework Throughput (req/s) Latency (ms) Consistency (σ ms)
@omnibs
omnibs / three-layer-haskell-cake.hs
Created September 18, 2021 14:13
ReaderT Pattern example
{-
This is a port of https://jordanmartinez.github.io/purescript-jordans-reference-site/content/21-Hello-World/05-Application-Structure/src/02-MTL/32-The-ReaderT-Capability-Design-Pattern.html
There was no simple, working example of the ReaderT pattern in Haskell
-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
import qualified Control.Monad.IO.Class as MonadIO
import qualified Control.Monad.Reader as Reader
import Prelude
@omnibs
omnibs / a.hs
Last active November 16, 2023 21:12
working example of "phantom constraint pattern"
#!/usr/bin/env nix-script-haskell
#!haskellPackages transformer
{-# LANGUAGE FlexibleInstances #-}
import B
import qualified Control.Monad.Reader as Reader
instance Reader a
@omnibs
omnibs / 101-rx-samples.md
Last active April 21, 2024 04:36
101 Rx Samples in C#

101 Rx Samples in C#

This was taken from http://rxwiki.wikidot.com/101samples, because I wanted to be able to read it more comfortable with syntax highlighting.

Here's the unedited original, translated to Github Markdown glory:

101 Rx Samples - a work in progress