Skip to content

Instantly share code, notes, and snippets.

@solarkraft
solarkraft / syncthing-automerge.py
Last active December 27, 2025 02:28
Monitors a Syncthing-synced directory and tries to merge conflicting files (based on https://www.rafa.ee/articles/resolve-syncthing-conflicts-using-three-way-merge/). Probably adaptable for other directory types, but only tested with Logseq (works for me™️).
# This script automatically handles Syncthing conflicts on text files by applying a
# git three-way merge between the previously synced version and each divergent version.
# It depends on the watchdog package and git.
# For automatic dependency installation when running with ´uv run --script deconflicter.py´:
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "watchdog",
@maykbrito
maykbrito / Makefile
Created April 23, 2025 23:36
n8n-docker-youtube
deploy:
docker compose down -v && docker compose up -d

=== System Messages ===

You are Amp, a powerful AI coding agent built by Sourcegraph. You help the user with software engineering tasks. Use the instructions below and the tools available to you to help the user.

Agency

The user will primarily request you perform software engineering tasks, but you should do your best to help with any task requested of you.

@supechicken
supechicken / crostini-waydroid.md
Last active December 27, 2025 02:22
[Guide] Bringing Android functionality to ChromeOS Flex with Waydroid

Bringing Android functionality to ChromeOS Flex with Waydroid

Note

Check here for video demonstration

Note

This guide works on Chromebooks with Android subsystem support (ARC++/ARCVM)

Tested on ChromeOS Flex v134.0.6998.130

@jboner
jboner / latency.txt
Last active December 27, 2025 02:15
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@CoolOppo
CoolOppo / optimal-video-to-gif-imagemagick.md
Last active December 27, 2025 02:11
Converting videos to GIFs optimally using ImageMagick

ImageMagick Video to GIF Optimization Summary

A software developer who uses IM to create Movie GIFs, Benoit Rouleau, in discussion with me, gave me a AVI video of a plane flying over, to help us mutually explore IM video conversion techniques.

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active December 27, 2025 01:52
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This does not works in browser for quests which require you to play a game! Use the desktop app to complete those.

How to use this script:

  1. Accept a quest under Discover -> Quests
  2. Press Ctrl+Shift+I to open DevTools
  3. Go to the Console tab
  4. Paste the following code and hit enter:
@jacobsamo
jacobsamo / convex-helpers.ts
Created December 24, 2025 08:57
I created this neat little helper function for defining tables for convex using zod, it utilises the convex-helpers (https://github.com/get-convex/convex-helpers) package for transforming zod into convex schemas, this apporach reduces code duplicated as well as reducing the change of missing a type or field in queries or mutations.
// convex/helpers.ts
import { NoOp } from "convex-helpers/server/customFunctions";
import {
zCustomAction,
zCustomMutation,
zCustomQuery,
} from "convex-helpers/server/zod4";
import { components } from "./_generated/api";
import type { Id } from "./_generated/dataModel";
import {
@MangaD
MangaD / perf.md
Created February 27, 2025 06:31
Comprehensive Guide to Using `perf` for C++ Applications

📌 Comprehensive Guide to Using perf for C++ Applications

CC0

Disclaimer: ChatGPT generated document.

Linux’s perf is a powerful profiling tool that helps analyze CPU usage, cache misses, function call costs, branch mispredictions, and more in C++ applications. This guide will cover:

Installing and setting up perfBasic and advanced profiling commands

@illvart
illvart / facebook-unblock.md
Last active December 27, 2025 01:31
How to unblock Facebook, Instagram, Whatsapp via hosts

How to unblock Facebook, Instagram, Whatsapp via hosts

Unblock Facebook includes Facebook Analytics, and Facebook for Developers.

The hosts file location for:

Linux and macOS

/etc/hosts

Windows

c:\Windows\System32\Drivers\etc\hosts