Skip to content

Instantly share code, notes, and snippets.

@jwbee
jwbee / jq.md
Last active July 2, 2025 14:28
Make Ubuntu packages 90% faster by rebuilding them

Make Ubuntu packages 90% faster by rebuilding them

TL;DR

You can take the same source code package that Ubuntu uses to build jq, compile it again, and realize 90% better performance.

Setting

I use jq for processing GeoJSON files and other open data offered in JSON format. Today I am working with a 500MB GeoJSON file that contains the Alameda County Assessor's parcel map. I want to run a query that prints the city for every parcel worth more than a threshold amount. The program is

@kmille
kmille / How to use a TPM on Linux.md
Last active June 1, 2025 10:08
How to use a TPM on Linux

This is part of a blog post I wrote: https://debugging.works/blog/tpm-explained/

How to use a TPM on Linux

Prerequisites

  • I use it on Arch Linux (systemd 257.3-1)
  • Install dependency: yay tpm2-tools (5.7-1)

Do I have a TPM 2.0?

@marijnvanwezel
marijnvanwezel / proofscript.ts
Created February 23, 2025 16:24
TypeScript as a proof assistant
// TypeScript can be used just like a proof assistant (for intuitionistic propositional logic)!
//
// Inspired by: https://www.youtube.com/watch?v=i-hRpYiNwBw
// We can encode False as the following recursive type, which can never
// be constructed (e.g. you would need { false: { false: { false: ... }}}).
type False = { false: False };
// True can be encoded as the inhabited singleton type "I", which
// has as its only inhabitant the string "I".
@generic-internet-user
generic-internet-user / wlcursor.md
Last active June 19, 2025 02:40
Wayland Cursor Lag

Wayland Cursor Lag: Just give me a break already...

I no longer consider any of this to be valid, and consider this entire adventure so far to have been intellectually dishonest and filled with questionable assumptions about everything, so, please, if you're reading this and got linked here, stop reading this and tell whoever linked you here to shut the f**k up already.

UPDATE: This (and, therefore, the promised bug reports) has been put on hold until I get around to getting actual evidence with the herein-mentioned RPi Pico + photoresistor setup, which is itself "delayed until further notice" because I simply have better and more important stuff to do[^1] right now.

UPDATE 2: Some madlad actually did it, only for GNOME though but that's still amazing

*UPDATE 3: Apparently, it's like this on purpose, at least

@chrisbck
chrisbck / gist:5b66068b1a459965dd54bfb662903aee
Created November 21, 2023 15:25
Rust Matching Example
// Taken from YouTube video by Jeremy Chone: https://www.youtube.com/watch?v=VQdStWU2ewY
use Activity::*;
pub enum Activity{
Sleeping(Option<u16>),
Skiing {resort: String},
Coding
}
@snej
snej / missing_includes.rb
Created October 2, 2023 16:19
Script to find missing std #includes in C++ headers
#! /usr/bin/env ruby
#
# missing_includes.rb
# By Jens Alfke <[email protected]>
# Version 2.0 -- 2 Oct 2023
# Copyright 2021-Present Couchbase, Inc.
#
# This script scans C++ header files looking for usage of common standard library classes, like
# `std::vector`, without including their corresponding headers, like `<vector>`. It similarly looks
# for standard C functions like `strlen` that are used without including their header (`<cstring>`.)
@osy
osy / tpm-rant.md
Last active June 24, 2025 10:23
TPM provides zero practical security

TPM provides zero practical security

TPM (Trusted Platform Module) is as useful for preventing real attackers as the TSA is at preventing real terrorists. The architecture is fundamentally flawed and most existing implementations are completely broken. I thought this argument was settled decades ago[1] when "trusted computing" was introduced mostly as a way to provide DRM and ownership capabilities to organizations. It has largely failed to impact the consumer market when it was introduced back in the early 2000s. However, recently there seems to be a movement by certain parties to reintroduce this failed product back to the market. Microsoft argues that in order to use Windows 11, you need TPM 2.0 compatible hardware because[2]:

The Trusted Platform Module(TPM) requirement ena

@lleyton
lleyton / translation.md
Last active June 1, 2025 23:37
(ENG) Open Source Business Challenges and Reality, Rui Ueyama

Open Source Business Challenges and Reality

Original Japanese note here.

Original Author: Rui Ueyama (creator of the mold linker)

Translated by @windowsboy111

Minimally edited by @lleyton

@hyperupcall
hyperupcall / settings.jsonc
Last active June 26, 2025 09:47
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{
@bladeSk
bladeSk / Unity-Linux-VSCode-Intellisense-Debugger.md
Last active May 10, 2025 13:21
How to install Unity3D on Ubuntu based Linux distros (Kubuntu, Xubuntu, POP_OS, Mint, Neon, Zorin, etc.).

How to install Unity3D on Ubuntu based Linux distros (Kubuntu, Xubuntu, POP_OS, Mint, Neon, Zorin, etc.).

This guide details how to install UnityHub, Unity, VS Code and how to get full C# support with IntelliSense and debugging.

Tested on Kubuntu 22.04.

Installing Unity Hub

Unity Hub won't run on Ubuntu newer than 20.04 because it depends on an outdated libssl. We need to manually install the package from 20.04: