unslopkit

Components / Code blocks

Merge conflict picker

A conflict with both sides shown between their markers and three choices above. Pick one and the other side is struck out and labelled dropped. Works without scripts.

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.

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-merge-conflict">
<div class="mc">
  <input class="r r-a" type="radio" name="ukc-code-merge-conflict-keep" id="ukc-code-merge-conflict-ours">
  <input class="r r-b" type="radio" name="ukc-code-merge-conflict-keep" id="ukc-code-merge-conflict-theirs">
  <input class="r r-c" type="radio" name="ukc-code-merge-conflict-keep" id="ukc-code-merge-conflict-both" checked>
  <div class="hd"><span class="fn"><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="M14 3H6v18h12V7z"/><path d="M14 3v4h4"/></svg><span><span class="dir">src/hours/</span>closed-days.ts</span></span><span class="cnt">Conflict 1 of 3</span></div>
  <div class="pick" role="group" aria-label="Choose what to keep">
    <label class="t-a" for="ukc-code-merge-conflict-ours"><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="M5 12.5l4.5 4.5L19 7.5"/></svg>Keep main</label>
    <label class="t-b" for="ukc-code-merge-conflict-theirs"><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="M5 12.5l4.5 4.5L19 7.5"/></svg>Keep holiday-hours</label>
    <label class="t-c" for="ukc-code-merge-conflict-both"><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="M5 12.5l4.5 4.5L19 7.5"/></svg>Keep both</label>
  </div>
  <pre class="src"><code><span class="l"><span class="k">export const</span> closedDays = [</span>
<span class="l">  <span class="s">"2026-12-25"</span>,</span>
<span class="l mk mk-a">&lt;&lt;&lt;&lt;&lt;&lt;&lt; main<span class="tag"><span class="kp">kept</span><span class="dp">dropped</span></span></span>
<span class="l ours">  <span class="s">"2026-12-31"</span>, <span class="c">// stocktake</span></span>
<span class="l mk">=======</span>
<span class="l theirs">  <span class="s">"2027-01-02"</span>, <span class="c">// staff day</span></span>
<span class="l mk mk-b">&gt;&gt;&gt;&gt;&gt;&gt;&gt; holiday-hours<span class="tag"><span class="kp">kept</span><span class="dp">dropped</span></span></span>
<span class="l">];</span></code></pre>
  <div class="ft">
    <p class="sum"><span class="s-a">Result keeps the stocktake day from main.</span><span class="s-b">Result keeps the staff day from holiday-hours.</span><span class="s-c">Result keeps both days, main first.</span></p>
    <button class="btn" type="button">Mark resolved</button>
  </div>
</div>
</div>

More code blocks

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

  • src/pricing/ticket.ts 86% lines8 of 10 branches
    18×export function ticketPrice(age: number, member: boolean) {
    18×  if (age < 5) return 0;
    15×  if (member) {
    6×    return age < 16 ? 4 : 9;1 of 2 branches
      }
    9×  if (age >= 65) {never true
    0×    return 8;never run
      }
    9×  return age < 16 ? 6 : 12;
    }
    • Ran
    • Some branches
    • Never ran

    Coverage gutter

  • import { Halden } from "@halden/sdk";
     
    // Reads HALDEN_KEY from your environment
    const halden = new Halden();
    const job = await halden.jobs.get("JS-2207");
    const invoice = await job.invoice();
    await invoice.send({ to: job.client });
    from halden import Halden
     
    # Reads HALDEN_KEY from your environment
    halden = Halden()
    job = halden.jobs.get("JS-2207")
    invoice = job.invoice()
    invoice.send(to=job.client)
    # The same call, straight to the API
    curl api.halden.example/v2/invoices \
      -H "Authorization: Bearer $HALDEN_KEY" \
      -d job=JS-2207 \
      -d send=true
    $ npx tsx send-invoice.ts
    ✓ Drafted INV-0418 from 22.5 h and 3 receipts
    ✓ Sent to Reyes Framing · $2,140.00
    $ 

    Snippet with terminal

  • Install with
    npm install @halden/sdkpnpm add @halden/sdkyarn add @halden/sdk

    v3.2.018 kB gzippedNode 18 and up

    Install command

  • halden sync~/crews/reyes
    $ halden sync --since monday
    Syncing 38 job sheets for Reyes Framing
    31/38
    ✓JS-2207Alder St refit22.5 h
    ✓JS-2211Garage roof, Pier Ln14.0 h
    !JS-2214Bathroom, Mill Lnno sign-off
    ✗JS-2216Back deck rebuildupload failed
     Uploading receipts, 4 of 9

    Terminal mid-run