Skip to content

Instantly share code, notes, and snippets.

View moleike's full-sized avatar
🤘
dare to think for yourself

Alexandre Moreno moleike

🤘
dare to think for yourself
View GitHub Profile
@moleike
moleike / closconv.lhs
Created June 5, 2021 01:41 — forked from jozefg/closconv.lhs
Tutorial on Closure Conversion and Lambda Lifting
This is my short-ish tutorial on how to implement closures in
a simple functional language: Foo.
First, some boilerplate.
> {-# LANGUAGE DeriveFunctor, TypeFamilies #-}
> import Control.Applicative
> import Control.Monad.Gen
> import Control.Monad.Writer
> import Data.Functor.Foldable
@moleike
moleike / benchmark.md
Created March 29, 2021 02:19 — forked from CertainLach/benchmark.md
Jrsonnet performance

Benchmark results

large_string_join

Command Mean [ms] Min [ms] Max [ms] Relative
jrsonnet large_string_join.jsonnet 16.5 ± 0.5 16.1 19.6 1.00
gojsonnet large_string_join.jsonnet 90.7 ± 3.8 85.6 104.0 5.49 ± 0.29
jsonnet large_string_join.jsonnet 69.5 ± 2.4 68.2 78.1 4.20 ± 0.20
sjsonnet large_string_join.jsonnet 760.6 ± 12.7 739.9 787.2 46.00 ± 1.67
@moleike
moleike / CC.hs
Created July 4, 2020 06:17 — forked from atennapel/CC.hs
Calculus of Constructions, normalization-by-evaluation, semantic typechecking
data Tm = Var Int | Ann Tm Tm | Abs Tm | App Tm Tm | Pi Tm Tm | Fix Tm | Uni
data Clos = Clos Tm Env
data Dm = DVar Int | DAbs Clos | DNeutral Int [Dm] | DPi Dm Clos | DFix Clos | DUni
type Env = [Dm]
capp :: Clos -> Dm -> Dm
capp (Clos b e) t = eval (t : e) b
vapp :: Dm -> Dm -> Dm
vapp a b =
@moleike
moleike / App.java
Created April 28, 2020 10:03 — forked from thomasdarimont/App.java
Simple AuthN & AuthZ example with Spring Boot / Security / Session
package demo;
import java.io.Serializable;
import java.security.Principal;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@moleike
moleike / pair_programming_roles
Created March 23, 2018 02:22 — forked from jordanpoulton/pair_programming_roles
Pair Programming Role Definitions - Driver:Navigator
Driver:
-Write the code according to the navigator's specification
-Listen intently to the navigators instructions
-Ask questions wherever there is a lack of clarity
-Offer alternative solutions if you disagree with the navigator
-Where there is disagreement, defer to the navigator. If their idea fails, get to failure quickly and move on
-Make sure code is clean
-Own the computer / keyboard
-Ignore larger issues and focus on the task at hand
-Trust the navigator - ultimately the navigator has the final say in what is written
@moleike
moleike / ssh_client.go
Created March 15, 2018 06:59 — forked from iamralch/ssh_client.go
SSH client in GO
package main
import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"strings"
@moleike
moleike / tmux-cheatsheet.markdown
Created March 9, 2018 04:13 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@moleike
moleike / Makefile
Created March 2, 2018 00:45 — forked from llj098/Makefile
a sample tcp server runs in kernel
obj-m += tcp_svr_sample.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clea
@moleike
moleike / memory_layout.md
Created January 14, 2018 16:59 — forked from CMCDragonkai/memory_layout.md
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore
@moleike
moleike / 00_input.conf
Created August 31, 2017 07:16 — forked from steveash/00_input.conf
ELK configuration for aggregating cassandra and spark logs
input {
lumberjack {
# The port to listen on
port => 5043
# The paths to your ssl cert and key
ssl_certificate => "/etc/pki/tls/certs/logstash-forwarder/logstash-forwarder.crt"
ssl_key => "/etc/pki/tls/private/logstash-forwarder/logstash-forwarder.key"
# default type, but this will already be set by logstash-forwarder anyways