Skip to content

Instantly share code, notes, and snippets.

View kolektiv's full-sized avatar
Building myself a secondary brain...

Andrew Cherry kolektiv

Building myself a secondary brain...
View GitHub Profile
joshburgess / newtypes-redux-api-actions.ts
Last active January 26, 2019 06:51
Using newtype-ts newtypes to dynamically generate multiple API Action types representing API request states
View newtypes-redux-api-actions.ts
import { Predicate } from 'fp-ts/lib/function'
import { Prism } from 'monocle-ts'
import { Newtype, iso, prism, unsafeCoerce } from 'newtype-ts'
interface Optimistic<A extends string>
extends Newtype<
readonly Optimistic: unique symbol
readonly phantom: A
brendanzab /
Last active October 10, 2022 06:36
A reading list that I'm collecting while building my Rust ES+CQRS framework:

Functional, Reactive, and Distributed Systems Bibliography


mythz / ServiceStack_FilesService.cs
Created December 27, 2011 04:49
ServiceStack RestFiles vs WCF Web APIs port
View ServiceStack_FilesService.cs
Contains the file manager implementation of ServiceStack's REST /files Web Service:
using System;
using System.IO;
using System.Net;
using RestFiles.ServiceInterface.Support;
ademar / gist:1016874
Created June 9, 2011 14:49
Combinators for logic programming
View gist:1016874
// Based on the article 'Combinators for logic programming' by Michael Spivey and Silvija Seres.
let rec inf_seq n = seq { yield n; yield! inf_seq (n+1) }
let rec lzw f l1 l2 =
LazyList.delayed ( fun () ->
match l1,l2 with
|LazyList.Nil, _ -> l2
|_, LazyList.Nil -> l1
View EventSourcing in Java 1.4
// Worth noting that restrictions prevented me from accessing libraries like the Apache Commons Guid and others
// Also, not production code - needs some TLC & refactoring love
// If I get time will be moved to a proper home in GitHub
package semeosis.eventsourcing.infrastructure;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
View WriterMonad.fs
open System
open System.Collections.Generic
type IMonoid<'T> =
abstract member mempty : unit -> 'T
abstract member mappend : 'T * 'T -> 'T
type MonoidAssociations private() =
static let associations = new Dictionary<Type, obj>()
static member Add<'T>(monoid : IMonoid<'T>) = associations.Add(typeof<'T>, monoid)