Skip to content

Instantly share code, notes, and snippets.

@hyperupcall
hyperupcall / settings.jsonc
Last active May 3, 2024 12:52
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!!
{
@slimsag
slimsag / README.md
Created December 2, 2022 06:17
mini server
OS Arch Model CPU RAM Storage
macOS arm64 2020 Mac Mini Apple Silicon M1 8 core 3.2ghz 8GB 512G SSD
macOS x86 Late 2014 Mac Mini Intel i7 8 core 3ghz 16GB 256G SSD
linux x86 Beelink GTR5 5900HX Ryzen 9 5900HX 8 core 4.6ghz 32GB 512G SSD
windows x86 Beelink GTR5 5900HX Ryzen 9 5900HX 8 core 4.6ghz 32GB 512G SSD
windows arm64 Windows Dev Kit 2023 Snapdragon 8cx Gen 3, 8 core ~3ghz 32GB 512G SSD
linux arm64 Radxa ROCK pi 5B RK3588 8 core ~2.4ghz 16G 512G SSD
  • Case: KENUCO SOHO Mini 10" Rack
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
// We'll have 128 tokens. Each token can be up to 32 characters long.
char token[128][32];
int lexer(char* input) {
@gtirloni
gtirloni / wsl-luks.md
Created May 2, 2022 12:44
Windows WSL2 and LUKS

If you have a LUKS-encrypted partition on another disk, it's easy to mount it inside WSL.

List your disks:

> wmic diskdrive list brief

Mount the whole disk inside WSL (using --bare so WSL doesn't attempt to mount it automatically):

#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average
@onlurking
onlurking / programming-as-theory-building.md
Last active April 19, 2024 22:31
Programming as Theory Building - Peter Naur

Programming as Theory Building

Peter Naur

Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct

@fay59
fay59 / Quirks of C.md
Last active January 23, 2024 04:24
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
@m93a
m93a / .XCompose
Last active December 9, 2023 06:15
Math symbols for the compose key
# Math
<Multi_key> <A> <A> : "∀"
<Multi_key> <E> <E> : "∃"
<Multi_key> <exclam> <E> <E> : "∄"
<Multi_key> <minus> <0> : "−"
<Multi_key> <KP_Subtract> <KP_0> : "−"
<Multi_key> <asterisk> <1> : "⋅"
<Multi_key> <KP_Multiply> <KP_1> : "⋅"
@antirez
antirez / lmdb.tcl
Created April 28, 2017 15:40
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <antirez@gmail.com>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
@bkaradzic
bkaradzic / orthodoxc++.md
Last active April 23, 2024 13:59
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?