Skip to content

Instantly share code, notes, and snippets.

View M3t0r's full-sized avatar
🎧
Editing "Rust in Production"

Simon Brüggen M3t0r

🎧
Editing "Rust in Production"
View GitHub Profile
#!/usr/bin/env -S cargo +nightly -Zscript --quiet
---
[package]
edition = "2024"
[dependencies]
oci-client = { version = "0.14.0" }
tokio = { version = "1", features = ["rt", "net", "macros", "fs", "process"] }
serde = { version = "1.0" }
serde_json = { version = "1.0" }
esphome:
name: airgradient
name_add_mac_suffix: true
platform: ESP8266
board: d1_mini
# Enable logging
logger:
wifi:
@M3t0r
M3t0r / toggle.scpt
Created October 22, 2019 19:16
Toggle macOS input method between two values
# adapted from https://stackoverflow.com/a/23741934/371128
tell application "System Events" to tell process "SystemUIServer"
tell (menu bar item 1 of menu bar 1 whose description is "text input")
# !! Sadly, we must *visibly* select (open) the text-input menu-bar extra in order to
# !! populate its menu with the available input sources.
click
tell menu 1
# I only have two input methods, so selecting the first that isn't active toggles them
click (first menu item whose value of attribute "AXMenuItemMarkChar" is not "✓")
end tell
# without -c:{vas} copy, ffmpeg would remux the whole file,
# but since we just want to change metadata, a simple copy is enough
ffmpeg -i "$input" -metadata title="$new_name" -c:v copy -c:a copy -c:s copy "$output"
@M3t0r
M3t0r / links
Created January 5, 2014 21:06
filter an HTML page in STDIN for every anchor and outputs URLs in href starting with "http".