Skip to content

Instantly share code, notes, and snippets.

View patmaddox's full-sized avatar
🤔
Trying to figure out how to look up comments I've left

Pat Maddox patmaddox

🤔
Trying to figure out how to look up comments I've left
View GitHub Profile
@patmaddox
patmaddox / jail.conf
Created April 11, 2022 19:23
freebsd vnet jail config
host.hostname = "pat-$name";
vnet;
mount.devfs;
exec.clean;
exec.start = "sh /etc/rc";
exec.stop = "sh /etc/rc.shutdown";
path = "/jail/$name";
devfs_ruleset = 6;
vnet.interface = "epair${epair}b";
exec.prestart = "ifconfig epair${epair} create up";
@patmaddox
patmaddox / 1_README.md
Last active December 25, 2021 20:01
Dorico sketch instrument definitions

These are not complete files. These are XML chunks that you need to incorporate into the respective XML files under /Applications/Dorico 3.5/Contents (right-click the app and choose "show package contents").

They provide Sketch Treble, Sketch Alto, and Sketch Bass instruments. Each instrument is a single staff played with a piano sound, and can be condensed.

Additionally, edit instrumentFamiliesDefinitions.xml and add instrument.keyboard.piano.alias.sketchtreble, instrument.keyboard.piano.alias.sketchalto, instrument.keyboard.piano.alias.sketchbass to the `` list for instrument family.keyboards

@patmaddox
patmaddox / git-annex-whereto.rb
Created July 6, 2021 19:10
a script to show which untracked files will get annexed and which will be tracked by git
#!/usr/bin/env ruby
largefiles = `git annex config --get annex.largefiles`
untracked_files = `git ls-files --others --exclude-standard`
annex_files = []
git_files = []
untracked_files.split("\n").each do |file|
`git annex matchexpression "#{largefiles}" --largefiles --file "#{file}"`
@patmaddox
patmaddox / realearn-config.json
Last active July 4, 2021 12:14
realearn config
{
"version": "2.9.1",
"id": "8ZvXxRON",
"controlDeviceId": "6",
"feedbackDeviceId": "6",
"defaultGroup": {},
"groups": [
{
"id": "805d20ec-3b00-48ca-bef3-8384f997bcad",
"name": "Drums"
class Object
def or_else
self
end
end
class NilClass
def or_else
yield
end
@patmaddox
patmaddox / 1_use-toggle.js
Last active April 2, 2020 15:35
toggles and hooks
import { useState, useCallback } from 'react';
export default function useToggle(initialState) {
const [isOn, setIsOn] = useState(initialState);
const turnOn = useCallback(() => setIsOn(true), [setIsOn]);
const turnOff = useCallback(() => setIsOn(false), [setIsOn]);
const toggle = useCallback(() => setIsOn(prevState => !prevState), [setIsOn]);
return { isOn, turnOn, turnOff, toggle, setIsOn };
}
@patmaddox
patmaddox / fluid_srp.rb
Created September 18, 2019 18:18
SOLID in Ruby is fluid
class Foo1
def foo
puts "hello foo"
end
end
module FooModule
def foo
puts "hello foo"
end
@patmaddox
patmaddox / _README.md
Last active April 7, 2019 02:05
dorico custom instrument groups

To add custom instruments, you need to modify some XML files under /Applications/Dorico 2.app/Contents/Resources. Only do this if you're comfortable doing something like that!

I have included the complete file contents here so you can just replace the existing files on disk. You will overwrite the following files in the Resources folder:

This configuration will create a new "Parts" instrument group at the top of the list. It provides three instruments:

@patmaddox
patmaddox / 01_README.md
Created April 7, 2019 01:19
dorico custom instruments

To add custom instruments, you need to modify some XML files under /Applications/Dorico 2.app/Contents/Resources. Only do this if you're comfortable doing something like that!

For instruments.xml and instrumentnames_en.xml, you will add new entries. I placed them after the Pianoforte entry.

If your computer isn't set to English, choose the correct localization file for your system.

For instrumentFamiliesDefinitions.xml you will replace the existing keyboards entry (essentially you add instrument.keyboard.piano.alias.part to the `` element for Keyboards.