Skip to content

Instantly share code, notes, and snippets.

View mkrogemann's full-sized avatar

Markus Krogemann mkrogemann

View GitHub Profile
cons = fn (a, b) -> fn x -> x.(a, b) end end
car = fn (p) -> p.(fn (q, _) -> q end) end
cdr = fn (p) -> p.(fn (_, q) -> q end) end
each = fn (list, func) ->
iter = fn (list, func, next) ->
(fn (a, nil) -> func.(a)
(a, b) -> func.(a); next.(b, func, next)
end).(car.(list), cdr.(list))
end
iter.(list, func, iter)
@nicbor
nicbor / snapshots.py
Last active October 23, 2020 16:27 — forked from Eyjafjallajokull/README.md
AWS EBS - Find unused snapshots - this script generates csv raport about snapshot usage
import re
import boto3
import csv
from botocore.exceptions import ClientError
ec2 = boto3.client('ec2')
def get_snapshots():
return ec2.describe_snapshots(OwnerIds=['self'])['Snapshots']
dbms.mode=CORE
dbms.connector.bolt.listen_address=:7691
dbms.connector.http.listen_address=:7481
dbms.connector.https.listen_address=:7371
causal_clustering.initial_discovery_members=localhost:5001,localhost:5002,localhost:5003
causal_clustering.discovery_listen_address=127.0.0.1:5001
causal_clustering.transaction_listen_address=:6001
causal_clustering.raft_listen_address=:7001
@starkcoffee
starkcoffee / .sh
Created August 10, 2016 16:30
Safe git YOLO
alias yolo='(git symbolic-ref HEAD | grep -vq master && cowthink -f stegosaurus "#YOLO" && git push --force-with-lease) || cowthink -f beavis.zen "You tried to push master, fool."'
@mikob
mikob / AWS, ELB, CF and Let's Encrypt
Last active June 2, 2024 02:55
AWS, ELB, Let's Encrypt
Elastic Load Balancer, CloudFront and Let's Encrypt
@vysakh0
vysakh0 / runlength.ex
Last active September 4, 2016 08:31
Run length encoding in elixir
defmodule Runlength do
def encode(<< first :: binary-size(1) , rest :: binary>>) do
encode({first, 1}, rest, "")
end
def encode({letter, count}, << letter :: binary-size(1) , rest :: binary>>, result) do
encode({letter, count + 1}, rest, result)
end
def encode({letter, count}, << diff :: binary-size(1) , rest :: binary>>, result) do
result = result <> to_string(count) <> letter
@txus
txus / README.md
Last active July 30, 2018 20:54
Memory as a dependently-typed effect (scroll down for examples!)

Memory as an effect

What if we treated memory as a side-effect?

Idris lets us track lots of things in the type system, in order to get errors at compile-time rather than at runtime. One of the tools that lets us do this in Idris is called Effects, and they're used to keep track of state, to manage file handlers, and lots more.

In barely 40 lines of Idris (which could be less if I had any idea what I'm

@col
col / setup_elixir_app_on_travis_ci.md
Last active July 4, 2020 17:46
Configure Elixir app on Travis CI

Configure Elixir app on Travis CI

Setup Build

  1. Create .travis.yml file in the base dir
  2. Enter the following content:
language: elixir
elixir:
 - 1.2
@rvanbruggen
rvanbruggen / loadgtfs.cql
Last active April 17, 2024 22:45
Loading and Querying GTFS data
//LOAD CSV script for GFTS data
create constraint on (a:Agency) assert a.id is unique;
create constraint on (r:Route) assert r.id is unique;
create constraint on (t:Trip) assert t.id is unique;
create index on :Trip(service_id);
create constraint on (s:Stop) assert s.id is unique;
create index on :Stoptime(stop_sequence);
create index on :Stop(name);
schema await
package main
import (
"fmt"
"io"
"os"
)
var path = "/Users/novalagung/Documents/temp/test.txt"