unslopkit

Components / Code blocks

Env file with reveal

An .env file with secrets masked behind an eye toggle, one value shown, and the variable that's still empty called out. For setup docs and settings.

.env.local4 of 5 set
  1. # Halden, test mode
  2. HALDEN_API_KEY=hidden, ends in 4f9chld_test_8Kq2Vn5x4f9c
  3. HALDEN_ENV=test
  4. DB_PASSWORD=hiddenlocal-dev-only
  5. # Webhooks
  6. HALDEN_WEBHOOK_SECRET=

    Empty Webhook checks fail until this is set. Copy it from Settings, then Webhooks.

Drawn in your kit, Plain.Change the look

The code

Plain HTML and CSS on your kit's variables. Put it next to tokens/variables.css from your kit's files and it draws in your look.

<div class="ukc-code-env-file">
<div class="env">
  <div class="hd"><span class="nm"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="5" y="11" width="14" height="10" rx="1"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/></svg><span>.env.local</span></span><span class="cnt">4 of 5 set</span><button class="tb" type="button"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="8" y="8" width="12" height="12" rx="1"/><path d="M16 8V4H4v12h4"/></svg>Copy names</button></div>
  <ol class="rows">
    <li class="cm"># Halden, test mode</li>
    <li class="kv">
      <input class="r" type="checkbox" id="ukc-code-env-file-key">
      <code><span class="key">HALDEN_API_KEY</span>=<span class="mask"><span aria-hidden="true">••••••••</span><span class="sr">hidden, ends in </span>4f9c</span><span class="real">hld_test_8Kq2Vn5x4f9c</span></code>
      <label class="eye" for="ukc-code-env-file-key"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/></svg><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 3l18 18"/><path d="M10.6 5.1Q11.3 5 12 5c6.5 0 10 7 10 7a17 17 0 0 1-3.2 4.2M6.6 6.6C3.8 8.4 2 12 2 12s3.5 7 10 7c1.9 0 3.6-.6 5-1.5"/><path d="M9.9 9.9a3 3 0 0 0 4.2 4.2"/></svg><span class="sr">Show HALDEN_API_KEY</span></label>
    </li>
    <li class="kv"><code><span class="key">HALDEN_ENV</span>=test</code></li>
    <li class="kv">
      <input class="r" type="checkbox" id="ukc-code-env-file-db" checked>
      <code><span class="key">DB_PASSWORD</span>=<span class="mask"><span aria-hidden="true">••••••••••••</span><span class="sr">hidden</span></span><span class="real">local-dev-only</span></code>
      <label class="eye" for="ukc-code-env-file-db"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/></svg><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 3l18 18"/><path d="M10.6 5.1Q11.3 5 12 5c6.5 0 10 7 10 7a17 17 0 0 1-3.2 4.2M6.6 6.6C3.8 8.4 2 12 2 12s3.5 7 10 7c1.9 0 3.6-.6 5-1.5"/><path d="M9.9 9.9a3 3 0 0 0 4.2 4.2"/></svg><span class="sr">Show DB_PASSWORD</span></label>
    </li>
    <li class="gap"></li>
    <li class="cm"># Webhooks</li>
    <li class="kv miss"><code><span class="key">HALDEN_WEBHOOK_SECRET</span>=</code><p class="hint"><span class="warn"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3l9.5 17h-19z"/><path d="M12 10v4M12 17h.01"/></svg>Empty</span> Webhook checks fail until this is set. Copy it from Settings, then Webhooks.</p></li>
  </ol>
</div>
</div>

More code blocks

All 24
  • unpaid.sql
    -- Unpaid and past due, oldest first
    SELECT j.code, c.name, i.total,
      current_date - i.due_on AS late
    FROM invoices i
    JOIN jobs j ON j.id = i.job_id
    JOIN clients c ON c.id = j.client_id
    WHERE i.paid_at IS NULL
      AND i.due_on < current_date
    ORDER BY late DESC;

    4 rows in 18 msExport CSV

    codenametotallate
    JS-2216Pier Ln Holdings6,900.0021
    JS-2207Reyes Framing2,140.009
    JS-2219Mill Lane Lofts1,212.504
    JS-2223O. Whitaker480.001

    Query and result

  • Guides · API keys

    Rotate a key without downtime

    Run halden keys rotate in your project folder. The old key keeps working for 24 hours, so a deploy that still reads HALDEN_KEY won't fail halfway.

    The CLI writes the new key to ~/.halden/config.toml. Rather click than type? Press Ctrl K in the dashboard and search for keys.

    Shortcuts in the docs

    Search the docs
    /
    Copy the focused snippet
    C
    Next or previous heading
    JK

    Inline code and keys

  • Deck INVOICE.FORCard 12 of 40
    00000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222222222222222222222222222222222222222222222222222222222222222222222222233333333333333333333333333333333333333333333333333333333333333333333333333333333444444444444444444444444444444444444444444444444444444444444444444444444444444445555555555555555555555555555555555555555555555555555555555555555555555555555555566666666666666666666666666666666666666666666666666666666666666666666666666666666777777777777777777777777777777777777777777777777777777777777777777777777777777778888888888888888888888888888888888888888888888888888888888888888888888888888888899999999999999999999999999999999999999999999999999999999999999999999999999999999 TOTAL=HOURS*RATE+PARTSINV00120
    Reads
          TOTAL = HOURS * RATE + PARTS
    • 1 to 5label
    • 6continuation
    • 7 to 72statement
    • 73 to 80sequence

    Punch card

  • LATEFEE.BASLENDING DESK27-NOV-26 PAGE 1

    10 REM LATE FEES, 25 CENTS A DAY AFTER 14 DAYS
    20 READ N
    30 FOR I = 1 TO N
    40 READ T$, D
    50 IF D > 14 THEN PRINT T$; " OWES $"; (D - 14) * .25
    60 NEXT I
    70 DATA 3
    80 DATA "DUNE", 21, "EMMA", 9, "ULYSSES", 30
    90 END
     

    Tear here

    RUN
    DUNE OWES $ 1.75
    ULYSSES OWES $ 4
    READY.
    9 lines · 2 patrons owe fees

    Fanfold printout

  • crontab · roastery-01
    30minute 6hour *day of month *month 1-5day of week

    runs/opt/roastery/bin/roast-plan --notify

    Every weekday at 06:30, Monday to Friday, in any month.

    Cron line, explained

  • Listing 4.2A running mean over tide gauge readings
    def moving_average(values, window):
        if window < 1 or window > len(values):
            return []
        total = sum(values[:window])
        out = [total / window]
        for i in range(window, len(values)):
            total += values[i] - values[i - window]
            out.append(total / window)
        return out

    Line 7Each step adds the newest reading and drops the oldest, so the loop never sums the whole window again.

    Book-style listing