Skip to content

Instantly share code, notes, and snippets.

-----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEYfa2iBYJKwYBBAHaRw8BAQdAozgbfu6aa4uXAglMgq9KYZ0dHnJxSFHxy/Bn
IM4Fc5+0H1RvbSBNaWxsZXIgPGdpdEBtZS50bWlsbGVyLmRldj6IkwQTFgoAOwUL
CQgHAgYVCgkICwIEFgIDAQIeAQIXgAIbARYhBNPyWk7Wje25hjqnVc8661gMX7YT
BQJh+Hv8AhkBAAoJEM8661gMX7YTugkBALKjXH4v/gagwmFvlotgvmNyGIfRy8yr
JTIzotEML7mBAP0UsV8o6VMzXTgqxumRmyUn0158sOMODqPFhP6T4Z8HBLgzBGH2
2LYWCSsGAQQB2kcPAQEHQIq4yLBAtPX2OMs/WoVclYL4xGtZU34E4R5epvmq9BBq
iPUEGBYIACYWIQTT8lpO1o3tuYY6p1XPOutYDF+2EwUCYfbYtgIbAgUJA8JnAACB
CRDPOutYDF+2E3YgBBkWCAAdFiEEkgbzn2DKoIjeAQwgprO6psG4YfwFAmH22LYA
# Configuration for Alacritty, the GPU enhanced terminal emulator
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty it self.
env:
# TERM env customization.
#
# If this property is not set, alacritty will set it to xterm-256color.
defmodule TenderList do
def cons(x, y), do: fn(m) -> m.(x,y) end
def car(cell), do: cell.(fn(x, _) -> x end)
def cdr(cell), do: cell.(fn(_, y) -> y end)
def test do
list = cons(1, cons(2, cons(3, 4)))
IO.puts car(list)
defmodule ErrorMonad do
def return(x) do
{:ok, x}
end
def and_then(m, f) do
case m do
{:ok, v} -> f.(v)
err -> err
end
package main
import (
"bufio"
"crypto/tls"
"log"
"net"
)
func main() {
@tmiller
tmiller / playground.rs
Created November 25, 2017 02:59 — forked from anonymous/playground.rs
Rust code shared from the playground
enum Expr {
Val(i32),
Div(Box<Expr>, Box<Expr>),
}
fn eval(expr: Expr) -> Option<i32> {
match expr {
Expr::Val(x) => Some(x),
Expr::Div(x, y) => {
let x = eval(*x)?;
diff --git a/io.c b/io.c
index 3707a69344..93b91e1450 100644
--- a/io.c
+++ b/io.c
@@ -20,6 +20,7 @@
#include <ctype.h>
#include <errno.h>
#include "ruby_atomic.h"
+#include <time.h>
@tmiller
tmiller / bootstrap.sh
Last active October 1, 2017 18:42
Setup consul on OSX
sudo mkdir -p /etc/consul.d
sudo mkdir -p /opt/consul
sudo chown -R tmiller:staff /etc/consul.d /opt/consul
"=============================================
" Initialization
"=============================================
" Load plug
call plug#begin('~/.config/nvim/bundle')
Plug 'duff/vim-scratch'
Plug 'elmcast/elm-vim'
Plug 'fatih/vim-go'
struct Catcher<K, V, T>
where
K: Eq + Hash + Copy,
V: Copy,
T: Fn(K) -> V
{
calculation: T,
cache: HashMap<K, V>,
}