Skip to content

Instantly share code, notes, and snippets.

View thewhodidthis's full-sized avatar
🔘

Sotiri Bakagiannis thewhodidthis

🔘
View GitHub Profile
@thewhodidthis
thewhodidthis / Makefile
Last active December 1, 2023 12:38
PPM byte beat maker
# The filenaming timestamp
D?=$$(date +"%Y%m%d%s")
# Pixmap dimensions
W?=64
H?=64
# How many pixels?
S?=$$(($W * $H - 1))
# Out image dimensions
w?=192
h?=192
@thewhodidthis
thewhodidthis / Makefile
Last active September 4, 2023 15:33
FMU MP3 episode download, edit, and archive
YEAR?=$$(date +%Y)
UUID?=$$(python -c "import uuid; print(uuid.uuid4())")
ITEM?=justmoreidlechatternot
BOOM?=$(notdir $(CURDIR))
SHOW?=WA
NAME?=$$(date +%Y%m%d%s)
run: get cut mp3 put
@rm -rf episode.mp3 *.wav
put:
@thewhodidthis
thewhodidthis / Makefile
Last active May 28, 2023 20:28
Worley noise maker
# The filenaming timestamp
D?=$$(date +"%Y%m%d%s")
# How many feature points?
R?=10
# Pixmap dimensions
W?=80
H?=45
# How many pixels?
S?=$$(($W * $H - 1))
# Out image dimensions
@thewhodidthis
thewhodidthis / Makefile
Last active May 17, 2023 19:11
Extremely random pixel sorted image maker
# The filenaming timestamp
D?=$$(date +"%Y%m%d%s")
# Pix or bitmap dimensions
W?=80
H?=45
# How many numbers total?
S?=$$(bc <<< "3 * $W * $H")
# How many samples?
G?=$$(bc <<< "3 * $H")
# Out image dimensions
build:
@mkdir $$(date +"%Y%m%d%s"); cd $$_; echo "$$(date +"%Y%m%d%s")" > index.html; zip ../"$$(date +"%Y%m%d%s")".zip -r .
@thewhodidthis
thewhodidthis / main.js
Created December 6, 2022 09:32
Common hashing algorithms in JS
export function crc32c(data, n = data.length, poly = 0xEDB88320) {
let crc = 0xFFFFFFFF
for (let i = 0; i < n; i += 1) {
crc = crc ^ data.charCodeAt(i)
for (let j = 0; j < 8; j += 1) {
crc = crc & 1 ? (crc >>> 1) ^ poly : crc >>> 1
}
}
@thewhodidthis
thewhodidthis / snippet.sh
Created February 15, 2022 04:54
Retouch image files to reflect EXIF dates
find ./*.jpg -exec sh -c 'touch -d $$(date -j -f "%Y:%m:%d %H:%M:%S" "$$(identify -format "%[EXIF:DateTimeOriginal]" {})" +%Y-%m-%dT%H:%M:%S) {}' \;
@thewhodidthis
thewhodidthis / README.md
Last active January 17, 2022 17:44
Draft SSG

Poor man's static site builder

Basic,

\
redcarpet content.md |          # 1. Parse markdown
mustache - data.yaml.mustache | # 2. Save as unescaped HTML in proxy template
mustache - layout.mustache |    # 3. Fill in page layout
tidy # 4. Fix indentation
@thewhodidthis
thewhodidthis / links
Last active July 16, 2022 19:14
Helps extract Bookmarks.plist data into JSON
/*
const run = async () => {
await sleep(1000)
console.log("One")
await sleep(1000)
console.log("Two")
}
run()
*/