Skip to content

Instantly share code, notes, and snippets.

@altercation
altercation / karabiner.edn
Created May 31, 2023 16:37
Karabiner Goku Config Snapshot - es
; {
; Karabiner-Elements Goku Config
; es@ethanschoonover.com / github: altercation
; -----------------------------------------------------------------------------
; SUMMARY
; Karabiner-Elements is a low level utility to manage macOS keyboard behavior.
; The JSON config for K-E is awkward to manage at any level of complexity and
; thus we use Goku to maintain the configuration in EDN and compile it out to
; native K-E JSON config.
; -----------------------------------------------------------------------------
@altercation
altercation / dataview_proj_sample.md
Last active December 29, 2023 22:54
Active Projects - Obsidian Dataview Sample - Ethan Schoonover
TABLE WITHOUT ID

	choice(striptime(date(today)) - striptime(file.mtime) <= dur("2 days"),
			"<span style=color:#859900;>●</span> ",
			choice(striptime(date(today)) - striptime(file.mtime) < dur("1 week"),
				"<span style=color:#b58900;>◐</span> ",
				"<span style=color:#dc322f;>⊗</span> "
			)
			) +
author title date description tags
Hugo Authors
Markdown Syntax Guide (modified es)
2023-01-09
Sample article showcasing basic Markdown syntax and formatting for HTML elements.
markdown
css
html
themes

Sample Markdown syntax file, modified from Hugo source by ES for Markdown editor comparison.

@altercation
altercation / on-unlock.scpt
Last active May 18, 2022 17:06
Applescript to call dispreset when connected to multiple displays
# I use EventScripts to call this on screen unlock
# https://www.mousedown.net/software/EventScripts.html
tell application "Image Events"
launch
set countDisplays to count displays
if countDisplays > 1 then
do shell script "/usr/bin/curl \"http://192.168.0.99:3091/button-mbp-docked-unlock-trigger?event=click\""
do shell script "/Users/es/bin/dispreset"
end if
@altercation
altercation / dispreset.sh
Created May 18, 2022 16:58
Display Reset Script for macOS
#!/bin/sh
# dispreset:
# When called reset displays to last known arrangement using displayplacer
# if called within a timeout period (30 seconds), swap position.
# This is to work around the fact that in certain multimonitor configurations
# macOS fails to properly ID the displays using serial numbers pulled in via
# EDID and so loses track about which monitor is left/right positioned.
@altercation
altercation / starship.toml
Created April 27, 2022 22:48
Starship Prompt TOML config
[username]
style_user = "yellow"
style_root = "red bold"
format = "[$user]($style)"
disabled = false
show_always = true
[hostname]
ssh_only = false
format = "[@](white)[$hostname](bold blue)"
% IANA WHOIS server
% for more information on IANA, visit http://www.iana.org
% This query returned 1 object
refer: whois.verisign-grs.com
domain: COM
organisation: VeriSign Global Registry Services
address: 12061 Bluemont Way
@altercation
altercation / basescan.sh
Last active November 14, 2021 20:48
Scanner to identify which of your basestations you are connected to for roaming fast switch analysis
#!/usr/bin/env sh
# macos base station scanner to analyze fast roaming, rssi, etc.
AIRPORT_CMD="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I"
if [ "$(whoami)" != "root" ]
then
sudo "$0"
exit
@altercation
altercation / mc
Last active January 2, 2022 20:00
macOS Minecraft Controller - Limit minecraft play to specific times
#!/bin/bash
# replace following with local user running minecraft
LOCALUSER=username
function mc_off () {
# echo "minecraft off"
spctl --add --label "Minecraft" /Users/flint/Library/Application\ Support/minecraft/runtime/jre-legacy/mac-os/jre-legacy/jre.bundle/Contents/Home/bin/java
spctl --disable --label "Minecraft"
pkill -f "Minecraft.app"
@altercation
altercation / ImportVariables.jsx
Created June 30, 2021 05:50 — forked from circleb/ImportVariables.jsx
Bulk Import Text Variables into InDesign
/* ***************************************************************** */
/* Compiled: 09.16.2020 by Ben Owen for 1torial.com
/* Tested in InDesign 2020 (15.1.1)
/* ben@benowen.net
/* Most of the code came from the InDesign script FindChangeByList.jsx
/* and the function setCustomTextVariable() by Jon S. Winters.
/*
/* DESCRIPTION
/* This script allows you to import a simple text file containing a
/* text variable list and registers them as "Custom Text Variables,"