Skip to content

Instantly share code, notes, and snippets.

View mattsta's full-sized avatar
🐢
Moving slowly and fixing things

Matt Stancliff mattsta

🐢
Moving slowly and fixing things
View GitHub Profile
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│( ● ) Thinking... │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
send q or ctrl+c to exit | send "/clear" to reset | send "/help" for commands | press enter to send — 0% context left
Failed to parse toolCall.arguments: {"command": ["bash", "-lc", "apply_patch << 'EOF'\n*** Begin Patch\n*** Add File: src/components/excerpt-section.tsx\n+import Link from 'next/link';\n+import { SectionHeading } from '@/components/section-heading';\n+import { Card, CardContent } from '@/components/ui/card';\n+import { BookCTA } from '@/components/book-cta';\n+import { Button } from '@/components/ui/button';\n+import { Info, BookMarked } from 'lucide-react';\n+\n+
@philipturner
philipturner / CostEstimates.md
Last active June 10, 2025 16:51
Estimating the cost to build a diamondoid replicator

Cost Estimates

Author: Philip Turner

Date Started: 3/3/2025

Date Completed: 3/6/2025

Abstract: Estimating the cost to build a diamondoid replicator

@Hotrod369
Hotrod369 / 1_Sieve_Script_Cheatsheet.md
Last active September 25, 2025 14:08
This Gist provides a comprehensive cheatsheet for Sieve scripts, covering various objects, attributes, parameters, and their possible values. Sieve is a powerful scripting language for filtering and organizing emails, commonly used with email clients and servers. This cheatsheet includes tests, actions, comparators, and extensions to help you cr…

Transfem Communication Protocol (TCP)

Section: Introduction

The Transfem Communication Protocol (TCP) is a secure and efficient protocol designed to facilitate seamless data transfer between connected entities. Emphasizing safety and efficiency, TCP establishes a reliable communication channel that ensures the integrity and confidentiality of transmitted data. By employing advanced encryption techniques and error-checking mechanisms, TCP aims to provide a trustworthy platform for exchanging information while minimizing the risk of data compromise or loss. This specification outlines the key principles, features, and mechanisms that govern the operation of the Transfem Communication Protocol, offering a comprehensive guide for developers and users seeking to harness its capabilities for various applications.

Section: Example

Below is an example of a data transfer with a handshake between Host 1 and Host 2.

@nckroy
nckroy / eran-hammer-oauth2-rant-20120726.md
Created January 21, 2021 00:15
OAuth 2.0 and the Road to Hell

(Scraped from the Internet Wayback Machine. Original content by Eran Hammer / hueniverse.com July 26, 2012)

OAuth 2.0 and the Road to Hell

They say the road to hell is paved with good intentions. Well, that’s OAuth 2.0.

Last month I reached the painful conclusion that I can no longer be associated with the OAuth 2.0 standard. I resigned my role as lead author and editor, withdraw my name from the specification, and left the working group. Removing my name from a document I have painstakingly labored over for three years and over two dozen drafts was not easy. Deciding to move on from an effort I have led for over five years was agonizing.

There wasn’t a single problem or incident I can point to in order to explain such an extreme move. This is a case of death by a thousand cuts, and as the work was winding down, I’ve found myself reflecting more and more on what we actually accomplished. At the end, I reached the conclusion that OAuth 2.0 is a bad

set -o pipefail
set -o errtrace
set -o nounset
set -o errexit
set -a
# Scratch mount is the device which will be mounted on /mnt
# and generally used for logs, core dumps etc.
if ! $(mount | grep -q /mnt) ; then
# Detected NVME drives
@devxpy
devxpy / midi_numbers.py
Last active June 17, 2025 17:59
A python script that converts MIDI message numbers to notes and instruments (and vice-versa)
INSTRUMENTS = [
'Acoustic Grand Piano',
'Bright Acoustic Piano',
'Electric Grand Piano',
'Honky-tonk Piano',
'Electric Piano 1',
'Electric Piano 2',
'Harpsichord',
'Clavi',
'Celesta',
@abedra
abedra / after_fixes
Last active August 29, 2015 14:15
hiredis blocking scenario
perf stat ./client
Error: Read timed out
Performance counter stats for './client':
0.963859 task-clock (msec) # 0.081 CPUs utilized
3 context-switches # 0.003 M/sec
0 cpu-migrations # 0.000 K/sec
236 page-faults # 0.245 M/sec
<not supported> cycles
@thomasdarimont
thomasdarimont / Redis_Stats.md
Last active January 31, 2023 17:27
Example for computing various running statistics with Lua in Redis backed by a hash

Running statistics with Redis and Lua

This is an example for computing running statistics with Lua backed by a hash in Redis. We support counting, average (with and without exponential smoothing), stddev, variance, min, max, sum of observed values. An example for approximating a running median can be found here: https://gist.github.com/thomasdarimont/fff68191d45a001b2d84

Data structure

We use a hash for storing various statistic value under the key "stats_value" in redis. Note: If you need a specific alpha value for smoothing the average, then set the desired alpha -> e.g. alpha 0.7. If alpha is 0.0 then no smoothing is applied.