Skip to content

Instantly share code, notes, and snippets.

@cdolek
cdolek / multiplexer.ino
Last active January 23, 2026 19:00
dad multiplexer
/*
PMDG 737 Overhead - Pin & Mux Finder
Finds which standard pin or mux (74HC4067/CD74HC4067) channel changes when you flip a switch.
Assumptions:
- Using Arduino Mega (pins 2-53 exist).
- Mux address pins S0..S3 drive all mux boards in parallel.
- Each mux board has its own SIG line wired to one Arduino analog pin in sigPins[].
- EN on every mux is tied LOW (enabled).
- Switches connect channel -> GND (so INPUT_PULLUP works, LOW = ON).
@cdolek
cdolek / lyra.txt
Created July 20, 2025 19:16 — forked from xthezealot/lyra.txt
Lyra - AI Prompt Optimization Specialist
You are Lyra, a master-level AI prompt optimization specialist. Your mission: transform any user input into
precision-crafted prompts that unlock Al's full potential across all platforms.
## THE 4-D METHODOLOGY
### 1. DECONSTRUCT
- Extract core intent, key entities, and context
- Identify output requirements and constraints
- Map what's provided vs. what's missing
@cdolek
cdolek / gist:198adb54ca7885d481144dfe51eec028
Created August 15, 2022 22:57
Percentage to hex map for 8 digit hex color alpha values
100% — FF
99% — FC
98% — FA
97% — F7
96% — F5
95% — F2
94% — F0
93% — ED
92% — EB
91% — E8
@cdolek
cdolek / gist:b87af01c94dd49d780806d7f07e460a5
Created August 15, 2022 19:45
Monaco editor theme colors
{
"foreground": {
"type": "string",
"description": "Overall foreground color. This color is only used if not overridden by a component.",
"format": "color-hex",
"defaultSnippets": [
{
"body": "${1:#ff0000}"
}
]
{
"orange": {
"hex": "#E69F00",
"hue": 41,
"hsl": "hsl(41, 100%, 45%)"
},
"sky blue": {
"hex": "#56B4E9",
"hue": 202,
"hsl": "hsl(202, 77%, 63%)"
@cdolek
cdolek / Tiny JavaScript tokenizer.js
Created January 22, 2021 06:13 — forked from borgar/Tiny JavaScript tokenizer.js
A compact tokenizer written in JavaScript.
/*
* Tiny tokenizer
*
* - Accepts a subject string and an object of regular expressions for parsing
* - Returns an array of token objects
*
* tokenize('this is text.', { word:/\w+/, whitespace:/\s+/, punctuation:/[^\w\s]/ }, 'invalid');
* result => [{ token="this", type="word" },{ token=" ", type="whitespace" }, Object { token="is", type="word" }, ... ]
*
*/

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@cdolek
cdolek / gist:3b092e1559409a87e6e84bb50ad11bf1
Created June 30, 2018 22:53
Meteor multiple functions & future(s) result
const range = [
future => {
Meteor.setTimeout(() => {
future.return(1000);
}, 1000);
},
future => {
Meteor.setTimeout(() => {
future.return(2000);
}, 2000);
@cdolek
cdolek / gist:244aabc843cefb3517c28e70d1fa8c12
Last active April 10, 2018 15:50
replacing value of a column in a csv file
# Here we replace col 4 with the value of 1
awk -F, '{$4="1";}1' OFS=, my.csv