Skip to content

Instantly share code, notes, and snippets.

// -*- mode: c++ -*-
#include "Kaleidoscope.h"
#include "Kaleidoscope-Macros.h"
#include "Kaleidoscope-LEDControl.h"
#include "Kaleidoscope-LEDEffect-BootGreeting.h"
#include "Kaleidoscope-LED-Stalker.h"
#include "Kaleidoscope-SpaceCadet.h"
// Macros
@burke
burke / lrl
Created January 31, 2022 17:16
#!/bin/bash
set -euo pipefail
plists=()
while read -r pl; do
plists+=("${pl}")
done < <(ls ~/Library/LaunchAgents)
len=${#plists[@]}
height=$((len + 2))
#!/usr/bin/env ruby
require('open3')
extra_fswatch_args, cmd_args = if (rest_index = ARGV.index('--'))
[ARGV[0...rest_index], ARGV[rest_index+1..-1]]
else
[[], ARGV]
end
@burke
burke / 0.zsh
Last active December 15, 2021 15:46
# fragment added to ~/.zshrc
zle-gasdf() { gasdf; zle .beginning-of-line; zle .kill-line; zle .accept-line }
zle -N zle-gasdf
bindkey 'å' zle-gasdf # Alt-A Canadian English
@burke
burke / json_type.rb
Last active September 24, 2021 17:02
class JSONTypeClass < T::Types::Base
ScalarType = T.type_alias { T.any(String, Numeric, NilClass, FalseClass, TrueClass) }
IterType = T.type_alias { T.any(ScalarType, T::Array[T.untyped], T::Hash[String, T.untyped]) }
def name
'JSON'
end
def valid?(obj)
# in this particular case I don't think it makes sense to distinguish
@burke
burke / 0test.rb
Created September 24, 2021 16:44
I'm going to hell for sure.
assert(JSONType.recursively_valid?({'a' => ['neato']}))
refute(JSONType.recursively_valid?({'a' => [:neato]}))
@burke
burke / 0.md
Created September 13, 2021 18:41

First, compile the shim:

gcc -Wall -O2 -fpic -shared -ldl bind.c -o bind.so

Now, run the demo and notice that it does what it looks like it does:

$ LD_PRELOAD=./bind.so ruby demo.rb
Save this in [[roam/css]] as a toplevel block, wrapped in "```css" and "```"
{ config, pkgs, lib, ... }:
{
rune.project.name = "shopify-pay";
rune.framework.rails.enable = true;
aspect.packages.include = with pkgs; [
geolite2 ngrok mysqlClient57 overmind watchman toxiproxy v8
];
rune.project.repoName = "pay";
# typed: true
# frozen_string_literal: true
require('dev')
require('fileutils')
module Dev
module Helpers
class APFSVolume
extend(T::Sig)