Skip to content

Instantly share code, notes, and snippets.

@johnstultz-work
johnstultz-work / testing-linux-scheduler.md
Last active November 21, 2025 05:02
How I test and debug the Linux kernel scheduler

How I test and debug the Linux kernel scheduler

For my work on proxy-exec, I’ve built up a collection of tests that I use to try to strain things and uncover issues. I’m sure there are lots of better ways, however I am but a simple caveman. Folks have asked about my process so I figured I'd try to document it. I’m likely forgetting things, but I’ll try to update as I think of them.

General configs that are useful to enable to find bugs

(I'll usually keep a custom test defconfig in my kerenl trees that have the options I see as useful/helpful enabled so others can re-create the same config easily):

CONFIG_PROVE_LOCKING
@itnirwana
itnirwana / bali.json
Last active November 21, 2025 09:14
Indonesia Regencies Geojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@LouisCAD
LouisCAD / FusedLocationFlow.kt
Last active May 23, 2024 12:11
Create a Flow of location updates on Android (using kotlinx.coroutines), backed by Fused Location Provider from Google Play Services.
/*
* Copyright 2019 Louis Cognault Ayeva Derman. Use of this source code is governed by the Apache 2.0 license.
*/
import android.location.Location
import com.google.android.gms.location.LocationCallback
import com.google.android.gms.location.LocationRequest
import com.google.android.gms.location.LocationResult
import com.google.android.gms.location.LocationServices
import kotlinx.coroutines.CancellationException
@bmaupin
bmaupin / free-database-hosting.md
Last active December 10, 2025 14:18
Free database hosting
@gaearon
gaearon / modern_js.md
Last active December 2, 2025 08:14
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@ErikAugust
ErikAugust / spectre.c
Last active October 7, 2025 15:37
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active December 15, 2025 00:31
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@Rich-Harris
Rich-Harris / footgun.md
Last active November 1, 2025 18:30
Top-level `await` is a footgun

Edit — February 2019

This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:

  • TC39 is currently moving forward with a slightly different version of TLA, referred to as 'variant B', in which a module with TLA doesn't block sibling execution. This vastly reduces the danger of parallelizable work happening in serial and thereby delaying startup, which was the concern that motivated me to write this gist
  • In the wild, we're seeing (async main(){...}()) as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problems
  • Therefore, a version of TLA that solves the original issue is a valuable addition to the language, and I'm in full support of the current proposal, which you can read here.

I'll leave the rest of this document unedited, for archaeological