Skip to content

Instantly share code, notes, and snippets.

View adamscott's full-sized avatar

Adam Scott adamscott

View GitHub Profile
@adamscott
adamscott / parse.mjs
Last active May 17, 2025 18:31
Get file with macro processed
import { existsSync } from "node:fs";
import { open, writeFile } from "node:fs/promises";
import * as path from "node:path";
import { parseArgs } from "node:util";
import { runInContext, createContext } from "node:vm";
const VERSION = "0.0.1";
const EMSCRIPTEN_INTERPOLATION_REGEX = /\{\{\{(.+?)\}\}\}/msu;
/** @type {import("node:util").ParseArgsOptionsConfig} */
@adamscott
adamscott / process_preprocessors_permutations.py
Last active May 16, 2025 16:01
Process C-like preprocessors permutations (by creating individual files for each permutation)
#!/usr/bin/env python3
import argparse
from enum import Enum
from io import TextIOWrapper, StringIO
from os.path import splitext
from pathlib import Path
from typing import Union
import re
import subprocess
import tempfile
@adamscott
adamscott / 00-howto.md
Last active February 25, 2025 19:20
Godot API introduction parser

How to run this

  1. Copy the requirements.txt file locally
  2. Run pip install -r /path/to/requirements.txt to install the dependencies.
  3. Copy the godot-api-intro.py file locally
  4. Run python /path/to/godot-api-intro.py init to initialize the local sqlite3 database (godot_version_doc.db)
  5. Run python /path/to/godot-api-intro.py parse /path/to/godot/repo <GODOT_VERSION> to enter data from that version.
  • The script will checkout the version specified.
@adamscott
adamscott / ca-multi.kbd
Last active January 31, 2025 18:57
Canadian Multilingual Standard keyboard layout (i.e. French Canadian Apple keyboards) for the FreeBSD virtual terminal
# Canadian Multilingual Standard keyboard
# by Adam Scott ([email protected])
#
# January 31, 2025
#
# Based on French Canadian keyboard
# by Alexandre Normand ([email protected])
# with the help of Demis ([email protected])
#
# July 4, 1999
@adamscott
adamscott / intro.md
Created August 29, 2024 15:56
Web game loading study

Intro

@adamscott
adamscott / custom.py
Last active April 27, 2025 18:03
My own Godot "custom.py" (useful default values and caching system for older versions)
#!/usr/bin/env python
from misc.utility.scons_hints import *
import distutils
import os
import platform as platform_module
from SCons.Script import ARGUMENTS
from SCons.Variables.BoolVariable import TRUE_STRINGS
@adamscott
adamscott / machine.js
Created March 16, 2021 05:20
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@adamscott
adamscott / machine.js
Last active March 16, 2021 04:08
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@adamscott
adamscott / machine.js
Last active February 13, 2020 21:34
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@adamscott
adamscott / machine.js
Last active February 12, 2020 22:26
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions