Skip to content

Instantly share code, notes, and snippets.

@unorsk
unorsk / recorder.ts
Created February 9, 2026 13:17
recorder.ts
#!/usr/bin/env bun
import { $, sleep } from "bun";
// ── Configuration ──────────────────────────────────────────────────
interface Step {
cmd: string;
pause?: number; // seconds to wait after command finishes (default: 1.5)
}
interface DemoConfig {
@unorsk
unorsk / Dockerfile
Last active January 21, 2026 12:27
Canned Claude Code
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y \
curl \
unzip \
git \
ca-certificates \
nodejs \
npm \
&& rm -rf /var/lib/apt/lists/*

Jujutsu (jj) Comprehensive Reference

Core Concepts

Fundamental Differences from Git

  • No staging area: Changes automatically tracked in working-copy commit
  • Bookmarks vs Branches: Bookmarks are just pointers, not states you're "on"
  • Change IDs: Stable identifiers that persist across rewrites (unlike commit hashes)
  • Working-copy commit: Actual commit that gets automatically amended after each command
  • Snapshot-based: Each commit records entire repository state
@unorsk
unorsk / gist:d8237c6a4f726c8823dd4b123c24f4d1
Last active February 10, 2025 19:02
so i don't forget how to debug (and) set tls in q
export SSL_VERIFY_SERVER=NO
q){"x"$x} each 2 cut "abcdef"
q).Q.hg`$":https://www.kx.com"
q)(-26!)[]
q).Q.hg`:https://gmail.com
q).color.red: "\033[0;31m"
q).color.green: "\033[0;32m"
q).color.yellow: "\033[0;33m"
q).color.blue: "\033[0;34m"
@unorsk
unorsk / aoc1.hs
Last active December 2, 2024 08:17
AOC2024 Haskell
import Data.List (sort, group, find, uncons)
import Data.Maybe (fromMaybe)
main :: IO ()
main = do
input <- readFile "aoc1.txt"
let
(left, right) = unzip $ map (\s -> case words s of [l, r] -> (read l :: Int, read r :: Int)) $ lines input
repeating = map (\(x:xs) -> (x, length (x:xs))) . group . sort $ sort right
distance1 = sum $ zipWith (\ l r -> abs $ l - r) (sort left) (sort right)
@unorsk
unorsk / files.sh
Created September 26, 2021 13:00
everytime when i run out of space
du -h -d 1
@unorsk
unorsk / moveZeroes.scala
Created September 15, 2021 13:35
283 Move Zeroes Leetcode solution
object Solution {
def moveZeroes(nums: Array[Int]): Unit = {
var lastUpdated = 0
nums.zipWithIndex.foreach { case (e, i) => {
if (i != lastUpdated) {
nums.update(lastUpdated, e)
nums.update(i, 0)
}
if (e != 0) {
lastUpdated += 1
@unorsk
unorsk / twoSum.scala
Created September 15, 2021 13:13
twosum lc problem in scala
package lc
import scala.collection.mutable
def twoSum (nums: Array[Int], target: Int): Option[Array[Int]] = {
val map = mutable.HashMap[Int, Int]()
nums.zipWithIndex.foreach((e, i) => {
map.get(target - i) match {
case None => map.put(i, e)
case Some(v) => return Some(Array(i, v))
@unorsk
unorsk / TwoSum.purs
Created August 9, 2021 08:41
a purescript solution to the Leetcode twosum problem
module TwoSum where
import Data.Array (head, tail)
import Data.HashMap
import Data.Maybe
import Effect
import Prelude
import Data.Foldable (for_)
import Effect.Console (log)
@unorsk
unorsk / TwoSum.elm
Created July 28, 2021 14:22
Leetcode Two Sum problem solution in elm
module TwoSum exposing (twoSum)
import Dict exposing (Dict)
twoSum : List Int -> Int -> Maybe (List Int)
twoSum nums target =
twoSumInternal nums target 0 Dict.empty
twoSumInternal : List Int -> Int -> Int -> Dict Int Int -> Maybe (List Int)
twoSumInternal nums target i dict =