unslopkit

Components / Code blocks

Cron line, explained

A schedule taken apart field by field, each value sitting over its name, then the same thing in plain words and the next three runs. For settings pages and ops docs.

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.

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-cron-explained">
<figure class="cx">
  <figcaption class="cap"><span class="k">crontab · roastery-01</span><button class="copy" type="button" aria-label="Copy the cron line"><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</button></figcaption>
  <div class="expr" role="group" aria-label="Schedule, field by field">
    <span class="fld"><code>30</code><span class="lb">minute</span></span>
    <span class="fld"><code>6</code><span class="lb">hour</span></span>
    <span class="fld any"><code>*</code><span class="lb">day of month</span></span>
    <span class="fld any"><code>*</code><span class="lb">month</span></span>
    <span class="fld"><code>1-5</code><span class="lb">day of week</span></span>
  </div>
  <p class="cmd"><span class="lb">runs</span><code>/opt/roastery/bin/roast-plan --notify</code></p>
  <p class="means">Every weekday at <b>06:30</b>, Monday to Friday, in any month.</p>
  <ol class="next" aria-label="Next three runs">
    <li><time datetime="2026-11-30T06:30">Mon 30 Nov, 06:30</time></li>
    <li><time datetime="2026-12-01T06:30">Tue 1 Dec, 06:30</time></li>
    <li><time datetime="2026-12-02T06:30">Wed 2 Dec, 06:30</time></li>
  </ol>
</figure>
</div>

More code blocks

All 24
  • 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

  • no_shows.ipynbPython 3.12 · busy

    No-shows by weekday

    Harlow Street Clinic, bookings from January to October 2026.

    [3]
    import pandas as pd
     
    visits = pd.read_csv("visits_2026.csv", parse_dates=["booked_for"])
    visits["weekday"] = visits["booked_for"].dt.day_name()
    [4]
    rate = visits.groupby("weekday")["no_show"].mean() * 100
    rate.round(1).sort_values(ascending=False).head(3)
    [4]
    weekday
    Monday       14.2
    Friday       11.8
    Wednesday     7.9
    Name: no_show, dtype: float64
    [*]
    visits.to_parquet("visits.parquet")

    Running for 4 s

    Notebook cells

  • Run 482 · main · a41c9e2

    Fix family ticket rounding

    Failed in 2m 03s

    1. PassedCheck out code2s
    2. PassedInstall dependencies41s
    3. PassedLint12s
    4. FailedRun tests1m 08s
      $ npm test
      PASS tests/cart.test.ts (14 tests)
      PASS tests/timeslots.test.ts (19 tests)
      FAIL tests/pricing.test.ts (9 tests, 1 failed)
        family ticket covers two adults and three children
          Expected: 38
          Received: 47.5
          at tests/pricing.test.ts:27:31
      Tests: 1 failed, 41 passed, 42 total
      Process exited with code 1

    Build log by step

  • src/hours/closed-days.tsConflict 1 of 3
    export const closedDays = [
      "2026-12-25",
    <<<<<<< mainkeptdropped
      "2026-12-31", // stocktake
    =======
      "2027-01-02", // staff day
    >>>>>>> holiday-hourskeptdropped
    ];

    Result keeps the stocktake day from main.Result keeps the staff day from holiday-hours.Result keeps both days, main first.

    Merge conflict picker

  • Filter a day with a rangeMarina bookings · Postgres

    AvoidThe function hides the column from its index.
    SELECT id, berth, starts_at
    FROM bookings
    WHERE date(starts_at) = '2026-12-05';
    PreferA plain range the index can walk.
    SELECT id, berth, starts_at
    FROM bookings
    WHERE starts_at >= '2026-12-05'
      AND starts_at <  '2026-12-06';

    Avoid and prefer

  • Git, the five you use daily

    • git switch -c fix/late-feesStart a branch and move onto it
    • git add -pStage your changes one hunk at a time
    • git commit --amend --no-editFold what is staged into the last commit
    • git stash push -m wip-feesPark unfinished work under a name
    • git log --oneline -5See the last five commits, one line each

    Swap fix/late-fees and wip-fees for your own names.

    Command cheat sheet