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
| // -*- 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 |
| #!/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 |
| # 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 |
| 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 |
| assert(JSONType.recursively_valid?({'a' => ['neato']})) | |
| refute(JSONType.recursively_valid?({'a' => [:neato]})) |
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) |