Skip to content

Instantly share code, notes, and snippets.

Using Apron on macOS

Install PPL.

brew install ppl

For some reason, installing from opam doesn't pick up the presence of PPL. We run ./configure manually to fix that.

@dariusf
dariusf / softmark.js
Last active October 9, 2023 10:05
Softmark workflow hacks
// Keybindings for compound rubrics
document.onkeypress = function(e) {
if (e.key === 'n') {
setTimeout(() => {
// both events have to be sent
document.dispatchEvent(new KeyboardEvent('keydown', {'key': 'j'}));
document.dispatchEvent(new KeyboardEvent('keyup', {'key': 'j'}));
setTimeout(() => {
document.dispatchEvent(new KeyboardEvent('keydown', {'key': 'k'}));
document.dispatchEvent(new KeyboardEvent('keyup', {'key': 'k'}));
@dariusf
dariusf / zipper-merged.ml
Created September 19, 2023 03:05
Various zippers
type 'a tree =
| Section of {
item : 'a;
children : 'a tree list;
}
let item a = Section { item = a; children = [] }
type 'a path =
| Top

Pandas

Mental model

Pandas is oriented around performing SIMD operations on arrays, and its API directly reflects this. Some operations may be less intuitive than they are in the SQL or stream processing worlds. Operations like apply and iter* which involve user-defined Python are generally slow.

Basics

@dariusf
dariusf / equations.md
Last active January 6, 2024 14:30
Equations spotted in the wild
@dariusf
dariusf / hello-shiviz.md
Created August 2, 2023 08:05
A ShiViz Hello World

Updated Feb 2022.

ShiViz visualizes space-time diagrams, a succinct way to represent distributed system executions.

The examples on the site are all rather large, so here's a tiny Hello World example which illustrates the input format and basic ideas.

client1 "message 1 sent" {"client1":1}
client2 "message 2 sent" {"client2":1}
server "message 2 received" {"server":1, "client2":1}
@dariusf
dariusf / zoom-chat-notifications-macos.md
Created August 2, 2023 08:01
Zoom chat notification hacks (macOS)

Updated Dec 2021.

Zoom doesn't have chat notifications. This is a problem when invigilating online exams.

If you're using macOS, notifications can be hacked on by using a bunch of scripts to tell when something on the screen changes.

Rectangles

The first piece is how to capture a small region of the screen.

@dariusf
dariusf / docker-virtualbox.md
Created August 2, 2023 07:58
VirtualBox for Docker users

VirtualBox for Docker users

Sometimes you need VirtualBox instead of Docker - when more isolation is required, or because a desktop environment is too hard to configure.

(Updated Sep 2021)

@dariusf
dariusf / godot-macos.md
Last active August 2, 2023 08:01
Godot + C# + VSCode (macOS)

Updated July 2022.

Install system dependencies:

brew install --cask mono-mdk dotnet-sdk godot-mono
brew install mono
#!/usr/bin/env bash
# This is safe to run in your paper directory, as it creates a copy of the files.
# to be uploaded in the $dest directory below.
# It assumes latexmk is used, and latexmk outputs go into a _build directory.
set -e
# build, as we need the bbl file
latexmk