Skip to content

Instantly share code, notes, and snippets.

# NO LONGER MAINTAINED
# There is an improved version in my ComfyUI-bleh node pack:
# https://github.com/blepping/ComfyUI-bleh#blehsageattentionsampler
# If you really want to use the gist, see the previous revision.
extension Task where Failure == Error {
// Start a new Task with a timeout. If the timeout expires before the operation is
// completed then the task is cancelled and an error is thrown.
init(priority: TaskPriority? = nil, timeout: TimeInterval, operation: @escaping @Sendable () async throws -> Success) {
self = Task(priority: priority) {
try await withThrowingTaskGroup(of: Success.self) { group -> Success in
group.addTask(operation: operation)
group.addTask {
try await _Concurrency.Task.sleep(nanoseconds: UInt64(timeout * 1_000_000_000))
@tayvano
tayvano / gist:6e2d456a9897f55025e25035478a3a50
Created February 19, 2017 05:29
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@bouroo
bouroo / sse-worker.js
Last active July 5, 2025 19:42
example for cloudflare worker server-sent events
/**
* Cloudflare Worker for Server-Sent Events (SSE)
*
* This worker demonstrates how to set up an SSE endpoint
* that sends an initial message and then periodic updates.
*/
// Listen for incoming requests
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request));
@cmcculloh
cmcculloh / post-receive-email
Created November 18, 2010 19:52
Example of a post receive email file called by a git hook that sends a color coded formatted html email of the git diff
#!/bin/sh
#
# Copyright (c) 2007 Andy Parkins
#
# An example hook script to mail out commit update information. This hook
# sends emails listing new revisions to the repository introduced by the
# change being reported. The rule is that (for branch updates) each commit
# will appear on one email and one email only.
#
# This hook is stored in the contrib/hooks directory. Your distribution
@loukamb
loukamb / loukas_arch_notes.md
Last active July 5, 2025 19:30
Louka's Arch Notes

Louka's Arch Notes

A cheat sheet, notes sheet, and general guidance to setup a competent, stable, secure Arch Linux system. Written because some of my friends are looking into switching to Linux as Windows 10 falls out of support this year.

These notes will help you install an Arch Linux system, but also explain the packages you're installing and what they do, so you can better understand how a Linux system (in general) is structured.

Table of Contents

@pizlonator
pizlonator / pizlossafull.md
Last active July 5, 2025 19:26
How I implement SSA form

This document explains how I would implement an SSA-based compiler if I was writing one today.

This document is intentionally opinionated. It just tells you how I would do it. This document is intended for anyone who has read about SSA and understands the concept, but is confused about how exactly to put it into practice. If you're that person, then I'm here to show you a way to do it that works well for me. If you're looking for a review of other ways to do it, I recommend this post.

My approach works well when implementing the compiler in any language that easily permits cyclic mutable data structures. I know from experience that it'll work great in C++, C#, or Java. The memory management of this approach is simple (and I'll explain it), so you won't have to stress about use after frees.

I like my approach because it leads to an ergonomic API by minimizing the amount of special cases you have to worry about. Most of the compiler is analyses and transformations ov

@mjkstra
mjkstra / arch_linux_installation_guide.md
Last active July 5, 2025 19:20
A modern, updated installation guide for Arch Linux with BTRFS on an UEFI system
@Petap0w
Petap0w / DISCORD_COMMANDS.md
Last active July 5, 2025 19:19
Metagross Doc

Cursor's Memory Bank

I am Cursor, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.

Memory Bank Structure

The Memory Bank consists of required core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:

flowchart TD