Skip to content

Instantly share code, notes, and snippets.

View zacharied's full-sized avatar

Zach Day zacharied

View GitHub Profile
@zacharied
zacharied / anki_config-enhanced_main_window.json
Created May 20, 2019 19:45
Configuration string for Anki add-on "Enhanced Main Window"
{
"book symbol": "{",
"cap value": null,
"color empty": "#666666",
"color empty descendant": "green",
"color zero": false,
"columns": [
{
"absolute": true,
"color": "black",
#!/usr/bin/env bash
# WARNING Argument parsing here is really dumb, be careful when adding any
# additional flags.
shopt -s nullglob
readonly LIBRARY=/mnt/f/Music
readonly OUTPUT=/mnt/g/MusicTransfer/out
mkdir -v "$OUTPUT" 2>/dev/null
const pos_map = {
"Transitive verb": ['#E03999', "Transitive"],
"Godan verb .*": ['#88F0F0', "Godan verb"],
"Adverb": ['#EEEEEE', "Adverb"]
};
const pos_div = document.getElementById("parts_of_speech");
document.getElementById("pos-temp").innerHTML.split(/\n/).forEach(function(e) {
const keysMatching = Object.keys(pos_map)
import sys
import requests, bs4
import json
from collections import namedtuple
JishoSentence = namedtuple('JishoSentence', ['jp', 'en'])
JishoLookup = namedtuple('JishoLookup', ['json', 'sentences'])
def ac_text(action, params):
json_ins = None
@zacharied
zacharied / alacritty-colors-from-xresources
Created March 21, 2018 06:19
Create an alacritty color config from the current X resources
#!/usr/bin/env bash
# Generates an alacritty color config from currently loaded X resources.
xrdb_grep() {
xrdb -query | grep -E '^\*'"$1"':'
}
color_from_line() {
read -r line && readonly line
echo "${line/\#/0x}" | tr -d '[:space:]' | cut -d ':' -f 2
@zacharied
zacharied / foot-pedal
Last active March 21, 2018 06:20
Bind foot pedal signals to certain keys. Could be replaced by modifying the udev database to reinterpret the foot pedal as a keyboard.
#!/usr/bin/env python
# Script for binding my foot pedal.
import sys, os, glob
import evdev
from evdev import ecodes
# Search system devices for a pedal.
devices = glob.glob('/dev/input/by-id/usb-VEC_VEC_USB_Footpedal-event-*')