Skip to content

Instantly share code, notes, and snippets.

@kylejohnston
kylejohnston / sample.code-workspace
Created April 25, 2020 00:56
VS Code Workspace
// Assumes this file is in ~/Sites/_workspaces
// The settings customize the color of the title bar
{
"folders": [
{
"path": "../folder-name"
}
],
"settings": {
"workbench.colorCustomizations": {
@kylejohnston
kylejohnston / northern-lights.pde
Last active January 25, 2025 22:54
A soothing processing sketch. Preview the output here: https://www.youtube.com/watch?v=k3yddvs_8aU
// preview the output here: https://www.youtube.com/watch?v=k3yddvs_8aU
// requires the Hype Processing Library
// https://github.com/hype/HYPE_Processing
import hype.*;
import hype.extended.behavior.HOscillator;
import hype.extended.colorist.HColorPool;
import hype.extended.layout.HPolarLayout;
// sketch variables
int stageW = 800;
@kylejohnston
kylejohnston / add-date.sh
Created March 15, 2025 16:56
On macOS, this script uses renames a file by appending the file's created date. For example, a file named IMG_000.jpg with a created date of Wednesday, January 1, 2025 at 10:09 AM would be renamed to 2025-01-01 IMG_000.jpg
#!/bin/bash
# Function to rename a file with its creation date prefix
rename_with_date() {
local file="$1"
# Skip if the file doesn't exist
if [ ! -f "$file" ]; then
echo "Error: File '$file' not found"
return 1
@kylejohnston
kylejohnston / gist:d403ca7887b482be771e62ebe049ee41
Created March 5, 2026 00:41
Karabiner Rule: caps l caps lock → hyper key ¦ double-tap=f12, long-press=f8
{
"description": "caps lock → hyper key ¦ double-tap=f12, long-press=f8",
"manipulators": [
{
"conditions": [
{
"name": "hyper_caps_tap",
"type": "variable_if",
"value": 1
}
@kylejohnston
kylejohnston / gist:14f1224f30c2fd60d62f0645d8c09110
Created March 5, 2026 20:15
Karabiner rule: caps lock = hyper key ¦ single-tap=f12, long-press=f8
{
"description": "caps lock = hyper key ¦ single-tap=f12, long-press=f8",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": { "optional": ["any"] }
},
"parameters": {
"basic.to_if_alone_timeout_milliseconds": 300,