Skip to content

Instantly share code, notes, and snippets.

@o-az
o-az / AGENTS.md
Last active November 14, 2025 13:55
tell your agent to wrap any command it runs with `command.sh`
  • Critical: when running any command, always wrap it with ~/dev/commands/command.sh in the following format:

    /bin/bash ~/dev/commands/command.sh --timeout 30 <command>

    Examples:

    • /bin/bash ~/dev/commands/command.sh --timeout 30 wrangler dev
  • /bin/bash ~/dev/commands/command.sh --timeout 30 bun dev

import * as React from 'react'
import { Porto, Mode } from 'porto'
import { WebView } from 'react-native-webview'
const porto = Porto.create({
mode: Mode.reactNative(),
})
const injected = /* javascript */ `
(function () {
@o-az
o-az / lru-cache.ts
Created September 15, 2025 12:58
In-memory LRU cache
type Node<K, V> = {
key: K
value: V
previous: Node<K, V> | null
next: Node<K, V> | null
}
export class InMemoryLru<Key, Value = unknown> {
private readonly capacity: number
private readonly map = new Map<Key, Node<Key, Value>>()
@o-az
o-az / github-auto-expand-diffs.js
Created September 11, 2025 23:51
GitHub Auto-Expand Diffs userscript
// ==UserScript==
// @name GitHub Auto-Expand Diffs
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Automatically expands all collapsed code sections in GitHub diffs
// @author You
// @match https://github.com/*
// @grant none
// @run-at document-idle
// ==/UserScript==
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@o-az
o-az / export-network-logs-chrome.md
Created July 20, 2025 02:37
A guide on how to gather network logs on Chrome

Export Network Logs on Chrome:

Gathering Network Logs in Chrome

  1. To the right of the address bar, click the Chrome menu icon () and then select More Tools > Developer Tools. The Chrome Developer Tools window will open.
  2. Click the Network tab.
  3. Select the Preserve log checkbox.
  4. Click the Clear icon (a circle with a line through it) to clear the network log.
  5. While the Developer Tools window remains open, reproduce the issue you are experiencing.
  6. After you have reproduced the issue, you can export the log as a HAR file. To do this, right-click anywhere in the list of network requests and select Save all as HAR with content.
@o-az
o-az / Dockerfile
Created July 9, 2025 00:23
standalone porto
FROM node:lts-bookworm-slim AS builder
RUN apt-get --yes update && apt-get --yes install \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN git clone https://github.com/ithacaxyz/porto.git .
@o-az
o-az / server.c
Last active June 22, 2025 04:51
simple server in C
// Pure C REST API Server - no external dependencies
// Compile with: gcc -o server server.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="color-scheme" content="light dark" />
<title>FF Android Synced Passkeys</title>
<style>