Skip to content

Instantly share code, notes, and snippets.

module test;
import core.memory : GC;
import core.sync.semaphore;
import core.sys.linux.sys.mman : MADV_DONTNEED, madvise;
import core.thread;
import std;
enum keys = [
"foo", "bar", "baz", "whee",
module test;
import core.memory : GC;
import core.sync.semaphore;
import core.thread;
import std;
static string[] keys = [
"foo", "bar", "baz", "whee",
"foo1", "foo2", "foo3", "foo4", "foo5", "foo6", "foo7", "foo8",
module test;
import core.memory : GC;
import core.sync.semaphore;
import core.thread;
import std;
static string[] keys = [
"foo", "bar", "baz", "whee",
"foo1", "foo2", "foo3", "foo4", "foo5", "foo6", "foo7", "foo8",
int main() {
unsigned char *target = mmap(NULL, 1024, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
Buffer buffer = {target, 1024, 0};
char *param = "Hello World\n";
void (*fn)(char*) = (void(*)(char*)) printf;
append_x86_64_push_reg(&buffer, X86_64_RBP);
append_x86_64_set_reg_reg(&buffer, X86_64_RBP, X86_64_RSP);
append_x86_64_set_reg_imm(&buffer, X86_64_RDI, (size_t) param);
append_x86_64_set_reg_imm(&buffer, X86_64_RAX, (size_t) fn);
append_x86_64_call_reg(&buffer, X86_64_RAX);
# bind ctrl-G to "directory up"
bind '"\C-g":"cd ..\C-m"'
# bind ctrl-E to "edit fuzzy"
function edit_fuzzy() {
TARGET=$(fzf)
if [ $? -eq 0 ]
then
echo -e "${PS1@P}edit $TARGET"
@FeepingCreature
FeepingCreature / seml.md
Last active March 2, 2023 13:17
SEML - Somewhat Easier YAML 1.0

SEML - Somewhat Easier YAML

This is a YAML variant intended to avoid having to read the absurdly large YAML spec. Every SEML document is also valid YAML, but not the reverse.

Each file corresponds to a JSON value. To avoid the Norway problem and similar issues, all values are parsed as strings.

This is version 1.0 of the SEML spec.

@FeepingCreature
FeepingCreature / gist:59db0470a21d6c4729ed201278fee111
Created March 2, 2023 08:02
SEML: Somewhat Easier Markup Language
# SEML - Somewhat Easier Markup Language
This is a YAML fork intended to avoid having to read the absurdly large YAML spec. Every SEML document is also valid YAML, but not the reverse.
Each file corresponds to a JSON object.
## Grammar
```
ALNUM := Unicode alpha plus digit properties
export FZF_DEFAULT_COMMAND='find -L * -type f -and -not -name \*.lst'
# bind ctrl-E to "edit fuzzy"
function edit_fuzzy() {
TARGET=$(fzf)
if [ $? -eq 0 ]
then
echo -e "${PS1@P}edit $TARGET"
history -s "edit $TARGET"
edit "$TARGET"
From 4f2c0ddcb3f402a4ec7dcb57dfec78c2719e4004 Mon Sep 17 00:00:00 2001
From: FeepingCreature <[email protected]>
Date: Fri, 4 Sep 2020 14:33:17 +0000
Subject: [PATCH] Mines: add mass-flag shortcut.
Right-click on a tiles where the count of covered adjacent tiles
matches the number of the tile - so that they are obviously all
bombs - and all covered adjacent tiles are flagged.
This provides symmetry with the left-click mass-reveal option.
@FeepingCreature
FeepingCreature / youre_doing_json_apis_wrong.md
Last active March 14, 2025 09:16
You Are Doing JSON APIs Wrong

You are doing JSON APIs wrong.

When you use JSON to call an API - not a REST API, but something like JSON-RPC - you will usually want to encode one of several possible messages.

Your request body looks like this:

{
 "type": "MessageWithA",