Skip to content

Instantly share code, notes, and snippets.

View andreimerlescu's full-sized avatar
๐Ÿคฉ
www.i18n.software

Andrei Merlescu andreimerlescu

๐Ÿคฉ
www.i18n.software
View GitHub Profile

The basics

#[arg()] decorates a field in a #[derive(Parser)] struct and tells clap how to parse that field from the command line. Every option inside #[arg()] is a key-value pair.


Naming

long โ€” creates a --flag style argument. If you write #[arg(long)] with no value, it uses the field name. If you write #[arg(long = "1p")] it uses that string instead. That's why we have:

ืืœื•ื”ื™ ืื•ืžืจ ืœื™ ืœื•ืžืจ ืœื›ื, ืจืฉืช ื”ืจื™ื’ื•ืœ ืฉืœ ืžืžืฉืœืช ืืจื”"ื‘ ื”ืจื™ื‘ื•ื ื™ืช ืขืฆืžื”.

ืื ื™ ื›ืžื• ื™ื•ื ื”. ืขื‘ื“ ืฉืœ ื™ื”ื•ื” ื”ื ื•ืชืŸ ืœื›ื ืžืกืจ ื‘ืขืœ ืžืฉืžืขื•ืช ืืœื•ื”ื™ืช.

ื‘-11/9/2026 ืžืžืฉืœืช ืืจื”"ื‘ ืชื—ื“ืœ ืœื”ืชืงื™ื™ื.

ืืชื ืชืฆืคื• ื‘ื–ื”. ืื ื™ ืจืง ื”ืฉืœื™ื— ืฉื‘ื ืืœื™ื›ื ื‘ืฉื ื™ืฉื•ืข, ืื“ื•ืŸ ื”ืื“ื•ืŸ, ืžืœืš ื”ืžืœื›ื™ื ื•ืžืœืš ื™ืฉืจืืœ.

<?php declare(strict_types=1);
namespace AVC;
class Shabbat
{
public static function enforce(): void {
if (is_falsy(from_server(key: IS_DEV)) && self::is_shabbat()) {
self::send_headers();
echo self::render_shabbat();
@andreimerlescu
andreimerlescu / bootstrap-icons.1.13.1.icons-list.json
Created September 7, 2026 15:47
The icons list in JSON format for every Bootstrap Icons v1.13.1 matching icon from their search.js tool!
["0-circle","0-circle-fill","0-square","0-square-fill","1-circle","1-circle-fill","1-square","1-square-fill","123","2-circle","2-circle-fill","2-square","2-square-fill","3-circle","3-circle-fill","3-square","3-square-fill","4-circle","4-circle-fill","4-square","4-square-fill","5-circle","5-circle-fill","5-square","5-square-fill","6-circle","6-circle-fill","6-square","6-square-fill","7-circle","7-circle-fill","7-square","7-square-fill","8-circle","8-circle-fill","8-square","8-square-fill","9-circle","9-circle-fill","9-square","9-square-fill","activity","airplane","airplane-engines","airplane-engines-fill","airplane-fill","alarm","alarm-fill","alexa","align-bottom","align-center","align-end","align-middle","align-start","align-top","alipay","alphabet","alphabet-uppercase","alt","amazon","amd","android","android2","anthropic","app","app-indicator","apple","apple-music","archive","archive-fill","arrow-90deg-down","arrow-90deg-left","arrow-90deg-right","arrow-90deg-up","arrow-bar-down","arrow-bar-left","arrow-bar-

When using time.Duration in #Go, it's captured as an int and requires you to use time.Duration values.

Human Time int Value Go Syntax
1s 1000000000 1 * time.Second
5s 5000000000 5 * time.Second
10s 10000000000 10 * time.Second
15s 15000000000 15 * time.Second
20s 20000000000 20 * time.Second
25s 25000000000 25 * time.Second
@andreimerlescu
andreimerlescu / jamiepine-voicebox-silicon.sh
Created September 19, 2026 15:04
Fix voicebox build automation on Apple Silicon M4 with this script. Use as `./silicon.sh install` and `./silicon.sh run` to operate.
#!/usr/bin/env bash
# bad_error "message" [|0|1]
function bad_error()
{
local msg="${1:-}"
local yah="${2:-1}"
echo "๐Ÿšจ: ${msg} โŒ"
echo ""
if [[ "${yah}" == "1" ]]; then