Skip to content

Instantly share code, notes, and snippets.

@aliou
aliou / index.ts
Created January 23, 2026 17:26
Sleep tool for testing abort behavior with multiple queued tools
/**
* Sleep Tool - For testing abort behavior with multiple queued tools
*/
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
import { Type } from "@sinclair/typebox";
export default function (pi: ExtensionAPI) {
pi.registerTool({
name: "sleep",
@aliou
aliou / index.ts
Last active January 23, 2026 16:23
Pi extension - A nice surprise
/**
* Surprise Extension
*
* Displays a countdown and then opens a surprise URL.
*/
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
import { exec } from "node:child_process";
import { platform } from "node:os";
@aliou
aliou / index.ts
Last active January 23, 2026 16:21
Pi extension test - stall compaction
/**
* Stall Compaction Extension (for debugging)
*
* Provides /stall-compact command to force-trigger compaction, and stalls it for 10 seconds
* to reproduce the Alt-Up "no queued messages to restore" bug.
*/
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
const STALL_SECONDS = 15;
@aliou
aliou / postmortem.md
Created May 5, 2020 14:32 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym

While going source spelunking, I came across this piece of code in Rails' ActiveModel:

key = "#{key.to_s.camelize}Validator"

begin
  validator = key.include?("::".freeze) ? key.constantize : const_get(key)
rescue NameError
@aliou
aliou / autoload-swiftcomplete.vim
Created April 28, 2018 12:28
autoload/swiftcomplete.vim
let s:cpo_save = &cpoptions
set cpoptions&vim
function! s:reduce(fct, list) abort
let [l:acc; l:tail] = a:list
while !empty(l:tail)
let [l:head; l:tail] = l:tail
let l:acc = a:fct(l:acc, l:head)
endwhile
@aliou
aliou / phoenix_to_umbrella
Created December 29, 2017 15:09 — forked from emilsoman/phoenix_to_umbrella
How to move an existing phoenix app under an umbrella app
How to convert existing phoenix app to an umbrella app.
https://elixir-lang.slack.com/archives/phoenix/p1472921051000134
chrismccord [10:14 PM]
@alanpeabody yes, it's straightforward
[10:14]
1) mix new my_umbrella --umbrella
@aliou
aliou / .profile
Created September 22, 2016 14:00 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else