Skip to content

Instantly share code, notes, and snippets.

@packerdl
packerdl / lxc_plex_intel_quicksync.md
Last active November 28, 2025 03:57
Intel QuickSync passthrough to an unprivileged LXC container running plex.

Running Plex in an Unprivileged LXC with Intel QuickSync Passthrough

First setup an unprivileged Ubuntu container with Plex Media Server installed. Inside the container take note of the id of the plex group.

# Your Plex group's ID may be different
$ getent group plex | cut -d : -f3
998
@pirate
pirate / alfred-clipboard.sh
Last active July 25, 2025 09:27
Script to manage searching, backing up, and collecting infinite clipboard history from the Alfred Clipboard History on macOS. Workflow UI: https://alfred.app/workflows/mayjunejuly/clipboard-history-archive/
#!/usr/bin/env bash
# This is a script that provides infinite history to get around Alfred's 3-month limit.
# It works by regularly backing up and appending the items in the alfred db to a
# sqlite database in the user's home folder. It also provides search functionality.
# 🎉 A NEWER IMPROVED VERSION OF THIS IN WORKFLOW FORM: 🚨
# ➡️ https://alfred.app/workflows/mayjunejuly/clipboard-history-archive/
# https://www.alfredforum.com/topic/10969-keep-clipboard-history-forever/?tab=comments#comment-68859
# https://www.reddit.com/r/Alfred/comments/cde29x/script_to_manage_searching_backing_up_and/
@Pathoschild
Pathoschild / stardew-mod-recommendations.md
Last active December 1, 2025 02:36
Stardew Valley mod recommendations

Here are the mods I recommend. These are all compatible with the latest versions of SMAPI and Stardew Valley on Linux/macOS/Windows. See the player's guide to using mods if you're interested.

Base frameworks

@naotokui
naotokui / emoji_regex.py
Created May 19, 2017 04:21
find unicode emoji in python regex
import re
emoji_pattern = re.compile(
u"(\ud83d[\ude00-\ude4f])|" # emoticons
u"(\ud83c[\udf00-\uffff])|" # symbols & pictographs (1 of 2)
u"(\ud83d[\u0000-\uddff])|" # symbols & pictographs (2 of 2)
u"(\ud83d[\ude80-\udeff])|" # transport & map symbols
u"(\ud83c[\udde0-\uddff])" # flags (iOS)
"+", flags=re.UNICODE)
@manuelbieh
manuelbieh / sequelize-schema-file-generator.js
Last active April 5, 2025 20:02
Automatically generates migration files from your sequelize models
import * as models from "models";
import Sequelize from "sequelize";
import fs from "fs";
delete models.default;
const sequelize = new Sequelize(
'',
'',
'', {
@vilicvane
vilicvane / cargo-shell.js
Last active April 13, 2020 22:56
Show rust build errors in Visual Studio Code.
var ChildProcess = require('child_process');
var task = process.argv[2];
var cargo = ChildProcess.exec('cargo ' + task);
cargo.stdout.on('data', function (data) {
process.stdout.write(data);
});
@jboner
jboner / latency.txt
Last active December 11, 2025 08:19
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