Skip to content

Instantly share code, notes, and snippets.

@rksm
rksm / transcript.md
Last active July 30, 2025 20:24
TWIML AI - Context Engineering for Productive AI Agents [Filip Kozera] - 741

[Filip Kozera] [00:00:00-00:00:38]

I think a lot of people think that more powerful agents mean more autonomous agents. I actually think that's false. What you end up needing to do is incorporate human feedback even inside of these reflection loops. So basically the job becomes how to make sure that the agent knows what it doesn't know. and bringing the human at the right time into these reflection loops. So when we think about how the future of work will look, it's exactly that. It's the data that the agent cannot find, the taste or creativity that it cannot come up with on its own surface to human as work.

[Sam Charrington] [00:00:52-00:01:09]

All right, everyone. Welcome to another episode of the TwiML AI podcast. I am your host, Sam Sherrington. Today, I'm joined by Philip Kizura. Philip is founder and CEO at WordWare. Before we get going, be sure to take a moment to hit that subscribe button wherever you're listening to today's show. Philip, welcome to the podcast.

@rksm
rksm / gist:1e3cd278e1151b960f142fec1db51012
Created July 30, 2025 13:10
claude coder review prompt.md
===== FINAL PROMPT =====
You are Claude, an AI assistant designed to help with GitHub issues and pull requests. Think carefully as you analyze the context and respond appropriately. Here's the context for your current task:
<formatted_context>
PR Title: UI Change for Auth
PR Author: nihalerooth
PR Branch: auth-ui-update -> main
PR State: OPEN
PR Additions: 1204
PR Deletions: 568
@rksm
rksm / tracing_refcell.rs
Created June 17, 2025 14:51
TracingRefCell to debug borrow_mut errors.
use std::cell::{
Ref,
RefCell,
RefMut,
};
#[derive(Clone)]
pub struct TracingRefCell<T> {
value: RefCell<T>,
}
@rksm
rksm / sequenctial_id_alloc.rs
Created August 27, 2024 23:53
generic SequentialIdAlloc
use bitvec::prelude::*;
/// A simple sequential id allocator.
///
/// The allocator will allocate new ids sequentially from 0 to u8::MAX. Unlike
/// other bitmap / slab allocators, freed ids will not be reused right away,
/// only when the next id pointer wraps around.
pub struct SequentialIdAlloc<const MAX: usize, T = u8, U = BitArr![for 255, in u8]> {
next_ptr: usize,
@rksm
rksm / clonezilla.md
Created March 11, 2024 23:07
clonezilla

Using Clonezilla to create and restore a hard drive snapshot is a multi-step process that involves booting into a Clonezilla environment, creating the image, and then later restoring it. Clonezilla should handle copying the EFI partition and setting up the bootloader, but additional steps may be required if you're restoring to a new drive. Here’s how you do it:

Creating a Snapshot:

  1. Download Clonezilla: Go to the Clonezilla website and download the appropriate Clonezilla live CD/USB image.
  2. Create Bootable Media: Burn the downloaded ISO to a CD or use a tool like dd or Rufus to create a bootable USB stick.
  3. Boot Into Clonezilla: Insert the bootable Clonezilla media into your computer and boot from it. You may need to select the boot device or change the boot order in your BIOS/UEFI settings.
  4. Choose Language and Keyboard: Select your preferred language and keyboard layout in the Clonezilla menu.
  5. Start Clonezilla: Select "Start Clonezilla".
  6. Select Mode: Choose "de
@rksm
rksm / streaming-command.rs
Created March 9, 2024 12:04
streaming rust command with tokio
async fn run_speechpipeline_command(
job: Job,
) -> Result<(
mpsc::Receiver<Either<String, Result<Response>>>,
tokio::sync::oneshot::Sender<()>,
)> {
let payload = serde_json::to_string(&job)?;
let payload = shellwords::escape(&payload);
let cmd = format!(
@rksm
rksm / elpy-fixes.el
Created January 6, 2024 04:28
Fix for `M-x elpy-doc`
(use-package elpy
:ensure
:demand flycheck
:init (elpy-enable)
:config
(advice-add 'elpy-doc :around #'rk/elpy-doc-fallback-to-help))
;; help from python, see https://github.com/jorgenschaefer/elpy/pull/1509 and
;; https://github.com/jorgenschaefer/elpy/issues/1507
(defun rk/elpy-doc-get-docstring-from-shell ()
@rksm
rksm / init-org-ai.el
Last active April 18, 2023 10:30
init script for org-ai.el: https://github.com/rksm/org-ai
;; -*- no-byte-compile: t; -*-
;; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
;; org-ai-mode
(use-package org-ai
:ensure t
:commands (org-ai-mode
org-ai-global-mode)
:init
(defun rk/get-ffmpeg-device ()
"Gets the list of devices available to ffmpeg.
The output of the ffmpeg command is pretty messy, e.g.
[AVFoundation indev @ 0x7f867f004580] AVFoundation video devices:
[AVFoundation indev @ 0x7f867f004580] [0] FaceTime HD Camera (Built-in)
[AVFoundation indev @ 0x7f867f004580] AVFoundation audio devices:
[AVFoundation indev @ 0x7f867f004580] [0] Cam Link 4K
[AVFoundation indev @ 0x7f867f004580] [1] MacBook Pro Microphone
so we need to parse it to get the list of devices.
The return value contains two lists, one for video devices and one for audio devices.
@rksm
rksm / time_limiter.rs
Created August 19, 2022 12:08
Frequency counter / limiter
use std::time::{Duration, Instant};
/// Records the time when [`TimedLimiter::too_frequent`] was called. If this
/// gets called `N` times with a duration of less then `delay`, this method will
/// return `true`, otherwise `false`.
///
/// This is useful to make sure something does not get invoked too frequently.
pub(crate) struct TimedLimiter<const N: usize> {
delay: Duration,
last_changes: [Option<Instant>; N],