Skip to content

Instantly share code, notes, and snippets.

View franklindyer's full-sized avatar
🤔
doing lots and lots of math

Franklin Pezzuti Dyer franklindyer

🤔
doing lots and lots of math
View GitHub Profile
# USAGE: .\multidir.ps1 --dirs "directory1,...,directoryn"
# Execute a sequence of commands sequentially in each of the directories
param (
[string]$dirs = ""
)
$dirlist = $dirs.Split(",")
While (($cmd = Read-Host -Prompt "multidir> ") -ne "exit") {
import Control.Exception
import Control.Monad.Cont
import Control.Monad.Identity
import Control.Monad.Reader
import Control.Monad.State.Lazy
import Control.Monad.Writer.Lazy
import System.IO
import System.Process
@franklindyer
franklindyer / franklin.xml
Last active April 7, 2024 21:47
My resume in XML
<?xml version="1.0"?>
<!DOCTYPE resume SYSTEM "../resume.dtd">
<resume>
<identity>
<name>Franklin Pezzuti Dyer</name>
<pronouns>He/him</pronouns>
</identity>
<contact>
@franklindyer
franklindyer / BrickToggler.hs
Created March 19, 2024 19:38
Haskell-brick toggling example
module Lib
( someFunc
) where
import Brick
import Brick (Widget, simpleMain, (<+>), str, withBorderStyle, joinBorders)
import Brick.Widgets.Center (center)
import Brick.Widgets.Border (borderWithLabel, vBorder)
import Brick.Widgets.Border.Style (unicode)
@franklindyer
franklindyer / code-annotation.html
Created March 12, 2024 05:53
Code annotation proof of concept
<head>
<style>
#main-container {
margin: auto;
width: 80%;
}
div.annotated-code {
font-family: Courier;
background-color: #dddddd;
@franklindyer
franklindyer / synch_test.py
Created February 6, 2024 07:07
Minimal two-thread synchronization example in Python
import time
import random
from threading import Thread
from multiprocessing.pool import ThreadPool
def print_ten(c):
for i in range(10):
time.sleep(0.1)
print(c, end="", flush=True)
print("")
@franklindyer
franklindyer / Harvard Case Law.js
Last active January 15, 2024 21:36
Draft Zotero translator for Harvard Case Law
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2022 YOUR_NAME <- TODO
This file is part of Zotero.
Zotero is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
@franklindyer
franklindyer / karabiner.json
Created January 1, 2024 22:27
Karabiner complex rule for balanced delimiter mapping
// Karabiner complex ruleset for convenient balanced delimiter mapping (macOS).
// To install, follow these steps:
// 1. Install Karabiner and give it permission to capture from your keyboard in System Preferences.
// 2. Go to "complex modifications" and click on "add your own rule".
// 3. Paste the below JSON configuration into the text box that opens, and click "save".
// Here are all of the mappings that it defines:
// - Map Ctrl+9 to (), placing cursor between parens
// - Map Ctrl+[ to [], placing cursor between brackets
// - Map Ctrl+] to {}, placing cursor between parens
// - Map Ctrl+4 to $$, placing cursor between dollar signs (for LaTeX)
@franklindyer
franklindyer / simple-repl.html
Last active December 5, 2023 23:40
Simple REPLs in HTML
<head>
<style>
div.repl {
background-color: black;
color: white;
font-family: Courier;
overflow-y: scroll;
height: 200px;
padding: 5px;
margin: 5px;
@franklindyer
franklindyer / broken-link-crawler.js
Last active April 4, 2024 01:53
Broken link finder