Skip to content

Instantly share code, notes, and snippets.

@kiliman
kiliman / cleanup-local-branches.sh
Last active October 9, 2025 21:48
Cleanup local branches after closing PR
#!/bin/bash
# Display help message
show_help() {
echo "Usage: $0 [options]"
echo ""
echo "This script cleans up or archives Git branches based on their PR status."
echo ""
echo "Options:"
echo " --help Show this help message and exit."
@kiliman
kiliman / add-host.sh
Last active October 8, 2025 01:36
Use Caddy to debug production site
#!/bin/bash
set -e
SCRIPT_DIR=$(dirname "$(realpath "$0")")
sudo bash "$SCRIPT_DIR/update-hosts" add "$1" "127.0.0.1"
sudo bash "$SCRIPT_DIR/update-hosts" add "$1" "::1"
@kiliman
kiliman / codemesh-log.md
Created October 3, 2025 19:06
CodeMesh Log file showing 3-step workflow plus augmentation

CodeMesh Session Log

New Session - 20:20:16

Version: 0.2.4

20:20:20 - discover-tools

Duration: 4.4s
Status: ✅ Success

Request

No arguments

@kiliman
kiliman / Remix-Logo-Black.svg
Created November 14, 2023 21:33
Remix logos with transparent background
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kiliman
kiliman / twitter-scroll-restore.js
Last active October 27, 2023 15:34
TamperMonkey script to fix Twitter scroll handling on replies
// ==UserScript==
// @name Twitter Scroll Restore
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author @kiliman
// @match https://twitter.com/*
// @icon https://www.google.com/s2/favicons?domain=twitter.com
// @grant none
// ==/UserScript==
@kiliman
kiliman / ts2js.sh
Last active April 7, 2025 18:01
Script to convert TypeScript files to JavaScript
#!/bin/bash
# Check if the correct number of arguments is provided
if [ "$#" -ne 2 ]; then
echo "Usage: $0 source_folder target_folder"
exit 1
fi
source_folder="$1"
target_folder="$2"
@kiliman
kiliman / types.ts
Created August 11, 2023 14:43
Type helpers
export type MakeOptional<Type, Key extends keyof Type> = Omit<Type, Key> &
Partial<Pick<Type, Key>>;
export type PickNullable<T> = {
[P in keyof T as null extends T[P] ? P : never]: T[P];
};
export type PickNotNullable<T> = {
[P in keyof T as null extends T[P] ? never : P]: T[P];
};
@kiliman
kiliman / index.js
Last active July 20, 2023 21:21
Script to create Remix and Expo apps for Nx - Expo support is still work in progress
const { spawn } = require("child_process");
const fs = require("fs");
const command = process.argv[2];
const appName = process.argv[3];
if (!fs.existsSync("apps")) {
fs.mkdirSync("apps");
}
if (fs.existsSync(`apps/${appName}`)) {
@kiliman
kiliman / github-open-npm.js
Last active August 10, 2024 15:53
TamperMonkey script to open the npm package by Ctrl/Cmd+click on import statement from GitHub code view
// ==UserScript==
// @name GitHub open npm from import
// @namespace http://tampermonkey.net/
// @version 0.1.1
// @description Opens the npm package by Ctrl/Cmd+click on import statement
// @author Kiliman
// @match https://github.com/*
// @icon https://www.google.com/s2/favicons?domain=github.com
// @grant none
// ==/UserScript==
@kiliman
kiliman / @remix-run+react+1.18.0.patch
Created June 26, 2023 21:25
Patch to add header to client-side requests in Remix
diff --git a/node_modules/@remix-run/react/dist/data.js b/node_modules/@remix-run/react/dist/data.js
index b3b935f..58a4874 100644
--- a/node_modules/@remix-run/react/dist/data.js
+++ b/node_modules/@remix-run/react/dist/data.js
@@ -61,6 +61,12 @@ async function fetchData(request, routeId, retry = 0) {
init.body = await request.formData();
}
}
+ init.headers = {
+ ...init.headers,