Skip to content

Instantly share code, notes, and snippets.

@jesserobbins
jesserobbins / claude-cache-timer.md
Last active September 4, 2026 21:27
Claude Code cache timer - status line showing prompt cache TTL with color-coded warnings

Claude Code Cache Timer

A status line + hooks combo that shows how long since your last API call, so you know when your prompt cache has expired (5-minute TTL). Works per-workspace so multiple sessions don't interfere.

Colors:

  • Green: cache warm (< 3 min)
  • Yellow: getting stale (3-4 min)
  • Red: about to expire (4-5 min)
  • Red + "expired": cache is gone, consider starting fresh
@awni
awni / open_code_mlx.md
Last active August 22, 2026 15:36
OpenCode with MLX

The following guide will show you how to connect a local model served with MLX to OpenCode for local coding.

1. Install OpenCode

curl -fsSL https://opencode.ai/install | bash

2. Install mlx-lm

@ryanpraski
ryanpraski / google_analytics_api_v3_10krows_nosampling_multiple_profiles_ryanpraski.py
Last active February 1, 2024 13:44
A solution for exporting more than 10,000 rows and a solution for the sampling limitations of Google Analytics using Python and the Google Analytics API. Includes functionality to pull data from multiple Google Analytics profiles.
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
:: F.E.A.R. low framerate workaround with Logitech hardware, by igordcard.
:: Official page URL: http://igordcard.blogspot.com/2013/01/sudden-fps-drop-in-fear-logitech.html
:: Steam version edit by zacr0.
:: 2013/01/26
@echo off
devcon disable HID\VID_046D* &:: Disable all Logitech HID devices.
devcon enable HID_DEVICE_SYSTEM_MOUSE &:: The previous command disables too much and the mouse may stop working, but this line fixes it.
start steam://rungameid/21090 &:: Run the game!
@xdamman
xdamman / install_ffmpeg_ubuntu.sh
Created July 2, 2014 21:03
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
@igordcard
igordcard / gmail.sh
Last active August 29, 2015 13:57 — forked from anonymous/gmail.sh
#!/bin/bash
function gmail() {
from=$1
user=$1
to=$2
stty -echo </dev/tty;
read -p "Password: " passw < /dev/tty
echo
stty </dev/tty echo
@igordcard
igordcard / pastebin.sh
Last active June 12, 2018 10:50 — forked from yevgenko/pastebin.sh
Updated to the latest Pastebin.com API.
#!/bin/bash
# Paste at Pastebin.com using command line (browsers are slow, right?)
# coder : Anil Dewani
# date : November 7, 2010
# forker : Igor Duarte Cardoso
# date : March 12, 2014
# Don't forget to set your Unique Developer API Key here
# http://pastebin.com/api#1
API_KEY=
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active June 3, 2026 23:24
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@chrisle
chrisle / simple_google_analytics.rb
Last active May 16, 2024 13:09
My simple Google Analytics API export API. Exports GA data as an array of flattened hashes with a SHA1 signature. No DSL, no sugar.
require 'digest'
# = simple_google_analytics.rb
#
# Chris Le <chris at iamchrisle dot com>
#
# This module is an wrapper to export data from Google Analytics as a flattened
# hash suitable for database storage. It does not require any other gems other
# than 'oauth'. I used this simply to get metrics and directly store them in
# a database.
@masak
masak / explanation.md
Last active October 16, 2026 11:58
How is git commit sha1 formed

(The below text is licensed with CC0, which means that if you want to use or translate it, that is OK by me.)

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>

Date: Sun Apr 15 16:35:03 2012 +0200