Skip to content

Instantly share code, notes, and snippets.

View alinpopa's full-sized avatar

Alin Popa alinpopa

View GitHub Profile
@alinpopa
alinpopa / finalTagless.ml
Created August 2, 2018 17:33 — forked from lambdahands/finalTagless.ml
Final Tagless in OCaml
(*
* An OCaml implementation of final tagless, inspired from this article by Oleksandr Manzyuk:
* https://oleksandrmanzyuk.wordpress.com/2014/06/18/from-object-algebras-to-finally-tagless-interpreters-2/
*)
module FinalTagless = struct
type eval = { eval : int }
type view = { view : string }
module type ExpT = sig
@alinpopa
alinpopa / gist:e2ea5ee2cdd1299488335135007761e1
Created July 24, 2018 06:53 — forked from relrod/gist:dd748c9ee0b111c3bd47
Pure IO in OCaml via the Free monad
(* Purely functional I/O in Ocaml via the Free monad.
* by Ricky Elrod <relrod@haskell.org>.
*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@alinpopa
alinpopa / bitset.go
Created January 20, 2018 09:41 — forked from gabriel-tincu/bitset.go
bitset
package bitset
import "fmt"
const (
chunkSize uint = 8
allSet uint64 = 1<<8 - 1
allReset uint64 = 0
)
@alinpopa
alinpopa / gist:1281448
Created October 12, 2011 15:05 — forked from vshkurin/gist:1109136
elasticsearch analyzer example - Test Queries
# Index
---------------------------------------------------------------------
curl -XPUT http://localhost:9200/pictures/ -d '
{
"settings": {
"analysis": {
"analyzer": {
"index_analyzer": {
"tokenizer": "standard",
@alinpopa
alinpopa / elasticsearch.yml
Created October 12, 2011 15:05 — forked from pcdinh/elasticsearch.yml
elasticsearch.yml example
name: ${HOSTNAME}
# The cluster should be named with the name of the AD domain
cluster:
name: bldrprod-0.14.0
routing:
allocation:
# As small as possible, very large performance hits during recovery
concurrent_recoveries: 1
package ca.jbrains.pos.test;
import static org.junit.Assert.*;
import java.util.*;
import org.junit.*;
public class SellOneItemTest {
public static class Sale {