Skip to content

Instantly share code, notes, and snippets.

View mnemnion's full-sized avatar

Sam Atman mnemnion

  • Eastern Standard Tribe
View GitHub Profile
@mnemnion
mnemnion / build.zig
Created July 29, 2024 15:35
Nondeterministic Zig Build with a Syscall
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
var prng = std.Random.DefaultPrng.init(blk: {
var seed: u64 = undefined;
std.posix.getrandom(std.mem.asBytes(&seed)) catch @panic("syscall error");
@mnemnion
mnemnion / build-output.log
Created March 13, 2024 19:16
Julia build failure output make VERBOSE=1
/path/to/julia/deps/tools/jldownload /path/to/julia/deps/srccache/JuliaSyntax-4f1731d6ce7c2465fc21ea245110b7a39f34658a.tar.gz https://api.github.com/repos/JuliaLang/JuliaSyntax.jl/tarball/4f1731d6ce7c2465fc21ea245110b7a39f34658a
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 477 100 477 0 0 1468 0 --:--:-- --:--:-- --:--:-- 1472
10 158k 10 16688 0 0 33051 0 0:00:04 --:--:-- 0:00:04 33051
100 158k 100 158k 0 0 274k 0 --:--:-- --:--:-- --:--:-- 1953k
/path/to/julia/deps/tools/jlchecksum /path/to/julia/deps/srccache/JuliaSyntax-4f1731d6ce7c2465fc21ea245110b7a39f34658a.tar.gz
@mnemnion
mnemnion / README.md
Last active October 17, 2023 20:44
HTML wrapper for class-enhanced create-table

Hover Over Me

SVG sharing sites (there's really only one) strip all script elements including CSS, so open this locally to see the effect.

@mnemnion
mnemnion / semantic-create-table.svg
Created August 28, 2022 16:48
SVG enhanced with class tags and some CSS
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mnemnion
mnemnion / class-tags-create-table.svg
Created August 28, 2022 16:47
create-table statement rendered with Pikchr class-tags branch
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mnemnion
mnemnion / trunk-create-table.svg
Created August 28, 2022 16:45
create-table statement rendered with Pikchr trunk
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mnemnion
mnemnion / git-move.sh
Created August 15, 2022 11:35
Move files from one git repo to another, following renames
#! /bin/bash
# Usage:
# ./git-move.sh path1/ path2/... path/to/destination/repo
args=("$@")
# All but last argument:
paths=("${args[@]::${#args[@]}-1}")
# Last argument:
dest="${args[${#args[@]}-1]}"
@mnemnion
mnemnion / curry.lua
Created November 7, 2020 05:16
Simple currying in Lua, partial application
-- Simple currying module
--
-- With a bit of extra complexity, so that
-- currying several times gives only one
-- level of function indirection for up to
-- five parameters.
-- weak table to store a reference to the curried
-- function, with the parameters and original function
local _curried = setmetatable({}, { __mode = 'k' })
@mnemnion
mnemnion / clone-to-trunk.sh
Last active September 8, 2020 17:51
change git trunk-branch name from master to trunk
git checkout master
git branch -m master trunk
git fetch
git branch --unset-upstream
git branch -u origin/trunk
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/trunk
@mnemnion
mnemnion / sparse.lua
Last active February 17, 2021 17:55
Sparse multidimensional tables in Lua
local Sparse = {}
local function new(dimension)
local sparse = {}
sparse._dimension = dimension
return setmetatable(sparse, Sparse)
end
function Sparse.__index(sparse, key)
if sparse._dimension == 1 then