Skip to content

Instantly share code, notes, and snippets.

@jtkot
jtkot / gleam_json_decoder.py
Created March 2, 2026 21:42
Generate gleam decoder from referential JSON file
#!/usr/bin/env python3
import json
import sys
import builtins
import re
import types
import string
from hashlib import md5
@jtkot
jtkot / check_version.sh
Created July 7, 2024 21:41
Check version of a macOS .pkg package
#!/bin/sh
set -e
file_path=`find . -type f -name "*.pkg"`
package_info=`xar -tf "${file_path}" | grep "PackageInfo"`
xar -xf "${file_path}" "${package_info}"
version=`grep "<pkg-info" "${package_info}" | grep -o " version=\".*\"" | cut -d\" -f 2`
rm -r `dirname "${package_info}"`
echo "version: ${version}"
@jtkot
jtkot / [Ignore chat]
Last active July 5, 2024 17:47
Ignore Facebook chat bookmarklet
javascript:"use strict";void function()%7Bconst a=document.location.hostname;if(%5B"messenger.com","facebook.com"%5D.every(b=>!a.endsWith(b)))return void alert("This script works on Facebook and Messenger only!");const b=document.location.href.match(/%5C/t%5C/(%5B0-9%5D+)/);return b%3Fvoid document.location.replace(function(a)%7Breturn%60https://mbasic.facebook.com/nfx/ignore_messages/%3Fthread_fbid=$%7Ba%7D%26location=www_chat_head%60%7D(b%5B1%5D)):void alert("Couldn't find a chat id!")%7D();
@jtkot
jtkot / Apple iTerm.itermcolors
Created May 26, 2024 11:47
Apple color scheme for iTerm
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.11764705926179886</real>
@jtkot
jtkot / juce.svg
Created February 8, 2018 13:08
JUCE C++ library logo SVG file
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.