Skip to content

Instantly share code, notes, and snippets.

View lincerely's full-sized avatar
🕹️

Lincerely lincerely

🕹️
View GitHub Profile
@futureengine2
futureengine2 / gi.c
Last active June 30, 2026 04:11
Radiance Cascades 2d GI implementation
static void gi_on_gpu(u8* in_bitmap, int w, int h) {
#define num_cascades 7
static bool initialized;
static gpu_bindgroup_t texture_bindgroup[2];
static gpu_bindgroup_t cascade_uniform_bindgroup[num_cascades];
static gpu_bindgroup_t render_uniform_bindgroup;
static gpu_buffer_t vertex_buffer;
static gpu_buffer_t uniform_buffer;
static gpu_pipeline_t pipeline;
@non
non / grep.tal
Last active February 18, 2025 04:43
Regex implementation in Uxntal. Includes a simple grep implementation was well as a REPL for testing.
( grep.tal )
( )
( by d_m )
( print a character to STDOUT )
%emit { #18 DEO }
( the first argument to grep is the regex )
( arguments are passed on STDIN, so we just )
( assume the first "line" is the argument )
@simoncozens
simoncozens / hands-face-space.ipynb
Last active April 19, 2025 06:32
Hands, Face, Space
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@TerryE
TerryE / NodeMCU-LGC-Notes.md
Last active July 5, 2024 14:26
Notes on the Lua Garbage Collector in the NodeMCU implementation

More notes on the Lua Garbage Collector in the NodeMCU implementation

Background

Lua employs automatic memory management for its objects. The Lua garbage collector (LGC) uses an incremental mark and sweep (M&S) strategy, in contrast to the reference counting strategy used by Python, etc.. The LGC is quite complex, and its detailed strategy and algorithms have been changed by the Lua development team in each of the Lua 5.x versions.

As is common practice for many other FLOSS source repositories, Lua's primary program documentation is the Lua source itself. The Lua code is largelyrr clear, readable, and broadly achieves this self-documenting goal. However in my view, the LGC is an exception here and thelgc.c could do with code cleanup to make it more transparently understandable, as many aspects of its implementation are clear as mud. There is a sparsity of other technical notes, specifications, etc. relating to the LGC and much of this information relates to old Lua versions, so other

@gingerbeardman
gingerbeardman / Motive.c
Last active December 12, 2021 16:28
The Soul of The Sims, by Will Wright. Macintosh HD:XmotiveHarness:src/Motive.c https://www.donhopkins.com/home/images/Sims/
// Motive.c -WRW 1/23/97
#include "SRand.h"
#include "utilities.h"
void SimMotives(int count);
void ChangeMotive(int motive, float value);
void SimJob(int type);
void AdjustMotives(int x, int y);

UPDATE

Although below are methods to extract the contents of a macOS package without actually installing it, the best way might be to create a blank disk image and install the package to this disk image in order to inspect the package contents. To do so:

  • Open the Disk Utility app.
  • Choose "File > New Image > Blank Image". Alternatively, simply press CMD-N.
  • Set the parameters and click on "Save" to create the blank disk image.
  • After creation, it should be already mounted. If not, you can mount it by navigating to the directory that it is placed at and double clicking on the disk image file.
  • Run the package installer by double clicking on the package file.
  • Select this newly created blank disk image as the destination and install it.
  • If the script is preventing you from installing by saying, for example, "macOS isn't installed", you can:
@rrrnld
rrrnld / README.md
Last active July 17, 2026 11:41
Interacting with your Firefox bookmarks and history from the command line

Firefox History and Bookmark Command Line Interface

These scripts use fzf and sqlite to efficiently query your firefox history and bookmarks. This is heavily inspired by a post from the creator of fzf: https://junegunn.kr/2015/04/browsing-chrome-history-with-fzf/. fzf allows you to select multiple items and the results returned will be the URLs.

What Does It Look Like?

asciicast

body {
font-size: 12px;
line-height: 1.5;
}
#page {
max-width: 500px;
margin: 15px;
word-wrap: break-word;
}
h1 {
-- Cross-format support for indices (LaTeX, HTML, EPUB, ...)
--
-- Syntax is based on LaTeX: https://en.wikibooks.org/wiki/LaTeX/Indexing
-- Creating entries: \index{key}
-- Creating the index: \printindex
-- ########## Shared data ##########
local indexEntryCounter = 0
local indexEntries = {}
@koteyur
koteyur / nasm_ex_sum.asm
Last active May 20, 2026 05:45
NASM Win32 example
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; NASM Win32 example: print result of X + Y
;
; Compilation:
; 1. Download NASM: https://www.nasm.us/
; Recommended version: nasm-2.14.02-win64.zip
; 2. Download Tiny C Compiler: http://tinycc.org/
; Recommended version: tcc-0.9.27-win64-bin.zip
; 3. Unpack it. For example: c:\soft\tcc, c:\soft\nasm
; 4. Compile: c:\soft\nasm\nasm.exe -felf nasm_ex_sum.asm