Skip to content

Instantly share code, notes, and snippets.


This is my current (as of 4/30/2020) Yabai and skhdrc config as well as the Ubersicht ( widget I use rather than the Yabai status bar. I went this route rather than the built-in status bar because I didn't like how Yabai as of 2.0.1 handled multiple monitors in the status bar.

Nothing is too far from defaults here, and the was something I found linked in an issue on Yabai's github page.

yelouafi /
Last active Mar 5, 2021
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) }
tomysmile /
Last active Mar 6, 2021
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis