Skip to content

Instantly share code, notes, and snippets.

yelouafi /
Last active Aug 5, 2020
Implementing Algebraic Effects and Handlers

Algebraic Effects in JavaScript part 4 - Implementing Algebraic Effects and Handlers

This is the final part of a series about Algebraic Effects and Handlers.

So we've come to the core topic. The reality is that we've already covered most of it in the previous parts. Especially, in the third part, where we saw delimited continuations at work.

yelouafi / multishot-callcc.js
Created Sep 21, 2018
multi shot continuations
View multishot-callcc.js
function isGenerator(x) {
return x != null && typeof === "function"
function isFrame(x) {
return x != null && x._type_ === 'call_frame'
function call(genFunc, ...args) {
573 / Dockerfile
Created Mar 12, 2018
git clone when using docker-compose.yml
View Dockerfile
FROM alpine/git:1.0.4
CMD ["git", "version"]
View Infrastructure.js
let cache = new Map();
let pending = new Map();
function fetchTextSync(url) {
if (cache.has(url)) {
return cache.get(url);
if (pending.has(url)) {
throw pending.get(url);

Table of Contents

  1. Basic syntax
  2. Flow Examples
  3. Advanced features
  4. Using with existing libraries (flow-typed and libdefs)
  5. Tooling
  6. Try

1. Basics

jstepien / reduce-and-gc.clj
Last active Mar 6, 2017
View reduce-and-gc.clj
;; Let's experiment with Clojure 1.8.0 running with a relatively small heap
;; of 10MB. To avoid any extra dependencies, we'll start it as follows:
;; java -Xmx10m -jar clojure-1.8.0.jar
;; Copy following expressions into your REPL one by one.
;; Let's take a small number, for instance one million.
(def small-num (* 1000 1000))
torgeir / clipboard-utils.clj
Last active Mar 1, 2017 — forked from Folcon/clipboard-utils.clj
Just a quick clipboard slip/slurp I put together because I didn't find anything similar, don't know if it's useful for anyone but found it invaluable when getting large strings being returned from the repl and sticking the result in an editor for more car
View clipboard-utils.clj
(defn get-clipboard []
(.getSystemClipboard (java.awt.Toolkit/getDefaultToolkit)))
(defn slurp-clipboard []
(if-let [contents (.getContents (get-clipboard) nil)]
(.getTransferData contents java.awt.datatransfer.DataFlavor/stringFlavor)))
(defn spit-clipboard [text]
(.setContents (get-clipboard) (java.awt.datatransfer.StringSelection. text) nil))
smat / Luke1.kt
Last active Dec 9, 2016
Julekalender 2016
View Luke1.kt
import java.lang.Math.floor
import java.lang.Math.log10
fun main(args: Array<String>) {
Stream.iterate(6, { it + 10 } )
.filter { swapFirstAndLastDigit(it) == 4 * it }
.map { println(it) }

Let's Encrypt with nginx + auto renewal

Let's Encrypt is a new, free, automated, and open Certificate Authority.

Find out more out Let's Encrypt, and how you can use in the Let's Encrypt documentation.

This file will guide you through the minimum things you need to set up Let's Encrypt on your nginx webserver.

View Tutorial.fsx
// This sample will guide you through elements of the F# language.
// *******************************************************************************************************
// To execute the code in F# Interactive, highlight a section of code and press Alt-Enter or right-click
// and select "Execute in Interactive". You can open the F# Interactive Window from the "View" menu.
// *******************************************************************************************************
// For more about F#, see:
You can’t perform that action at this time.