Skip to content

Instantly share code, notes, and snippets.

View build.md
jon at kestrel in ~/fs/git/kubernetes-client-haskell(master|…)
$ git reset --hard
HEAD is now at 94ee7cc Merge pull request #92 from jonschoning/fix-incorrectly-generated-querystrings

jon at kestrel in ~/fs/git/kubernetes-client-haskell(master|…)
$ stack build
kubernetes-client-core> build (lib)
kubernetes-client-core> Preprocessing library for kubernetes-client-core-0.4.2.0..
kubernetes-client-core> Building library for kubernetes-client-core-0.4.2.0..
@jonschoning
jonschoning / do_nothing_script.py
Created Nov 4, 2021 — forked from snth/do_nothing_script.py
Procedural version of do nothing script
View do_nothing_script.py
import sys
def wait_for_enter():
input("Press Enter to continue: ")
def create_ssh_keys(context):
"""Run:
ssh-keygen -t rsa -f ~/{username}
"""
pass
View klein-ps
/usr/bin/xscreensaver -nosplash
xwinwrap -b -fs -sp -fs -nf -ov -- nice -n 19 /usr/lib/xscreensaver/klein -root -view-mode walk -mode wireframe -speed-wx 0.01 -speed-wy 0.01 -speed-wz 0.01 -speed-xy 0.1 -speed-xz 0.01 -speed-yz 0.01 -walk-direction -14.3363 -walk-speed .03 -window-id WID
/usr/lib/xscreensaver/klein -root -view-mode walk -mode wireframe -speed-wx 0.01 -speed-wy 0.01 -speed-wz 0.01 -speed-xy 0.1 -speed-xz 0.01 -speed-yz 0.01 -walk-direction -14.3363 -walk-speed .03 -window-id 0x5c00001
View pactl-obsvirtual
pactl load-module module-null-sink sink_name="obsvirtual_sink" sink_properties=device.description="obsvirtual" # Create Sink
pactl load-module module-remap-source source_name="obsvirtual_source" master="obsvirtual_sink.monitor" # Create Source
@jonschoning
jonschoning / facebook-messages-declutter.js
Last active Nov 29, 2020
Facebook messages: Declutter
View facebook-messages-declutter.js
// ==UserScript==
// @name Facebook messages: Declutter
// @version 1
// @grant none
// ==/UserScript==
const SPECS =
[ { selectors: `._4_j5`, description: 'remove right pane', action: action_remove, enabled: true }
,
];
@jonschoning
jonschoning / build.sh
Created Nov 27, 2020 — forked from angerman/build.sh
Cross compiling ws-tunnel
View build.sh
# prefetch wstunnel's master for nix, and store the result in wstunnel.json
nix-prefetch-git https://github.com/erebe/wstunnel > wstunnel.json
# and build the wstunnel-tarball with nix, using the haskell.nix infra structure as above (see default.nix)
nix build \
-f default.nix \
rpi64-musl.wstunnel-tarball \
-o rpi64-musl-wstunnel-tarball
--arg wstunnel-json ./ws-tunnel.json
View records.cs
using System;
static void Run()
{
Employee foo = new Employee("Aysha", "Stein", "1234");
Person bar = (Person)foo with { FirstName = "John", LastName = "Doe"};
Console.WriteLine($"foo: {foo}");
Console.WriteLine($"bar: {bar}");
View .xscreensaver
# XScreenSaver Preferences File
# Written by xscreensaver-demo 5.42 for jon on Mon May 4 21:24:53 2020.
# https://www.jwz.org/xscreensaver/
timeout: 1:00:00
cycle: 1:00:00
lock: True
lockTimeout: 0:00:00
passwdTimeout: 0:05:00
visualID: default
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Random Roads</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/seedrandom/3.0.5/seedrandom.min.js"></script>
</head>
View continuations-and-reduction-semantics.md

Monads and delimited control are very closely related, so it isn’t too hard to understand them in terms of one another. From a monadic point of view, the big idea is that if you have the computation m >>= f, then f is m’s continuation. It’s the function that is called with m’s result to continue execution after m returns.

If you have a long chain of binds, the continuation is just the composition of all of them. So, for example, if you have

m >>= f >>= g >>= h

then the continuation of m is f >=> g >=> h. Likewise, the continuation of m >>= f is g >=> h.