Skip to content

Instantly share code, notes, and snippets.

@44100hertz
44100hertz / phoneticspell.lua
Created March 11, 2022 06:09
Takes espeak output, makes it into sort-of-readable phonetic language inspired by Sayspel
local input =
[==[
Put Your input text here.
]==]
local phonemes = {}
do
local h = io.popen('espeak -w /dev/null -x "' .. input .. '"')
phonemes = h:read('*a')
h:close()
@44100hertz
44100hertz / degrade.sh
Created April 23, 2021 21:11
deep fry images (requires imagemagick)
#!/bin/bash
convert $1 $2
for i in {1..8} # number of passes
do
case $(( $RANDOM % 22 )) in # set to 23 to enable swirl effect
1)
convert $2 -resize 75% -filter point -quality 15 $2
echo "resized 75%";;
@44100hertz
44100hertz / ideology.lua
Created November 20, 2020 02:11
Ideology Generator
local function create_ideology (_vocab)
-- Output ideology (array of strings)
local id = {}
-- Take random entries from vocab
-- Consumes entries to reduce redundancy
local vocab = {}
local function getv ()
if #vocab == 0 then
@44100hertz
44100hertz / lua-ex.org
Last active May 26, 2022 18:32
Possible lua extension concepts

Extended Lua concept

Intro

This is a pet project of mine, a sort of thought experiment about what would fit into lua without breaking convention (except the minimalist convention lol). I think many of the elements could combine into a new language, but there is no current plan to do that.

Goals

  • Make lua more pleasent
  • Maintain lua conventions
@44100hertz
44100hertz / news2020-6-16.org
Last active June 16, 2020 15:31
Mid June news stories

News

US

US Sanctions ICC when they just want to check if we did war crimes

The International Criminal Court (ICC) claims to have a neutral perspective. They made some accusations about human rights in Venezuela that I am skeptical of. The ICC wants to investigate the US for war crimes and the US said hell no we are gonna sanction you using your investigation of afghanistan as an excuse.

ICC statement: https://www.icc-cpi.int/Pages/item.aspx?name=200611-icc-statement

@44100hertz
44100hertz / nicknotes.org
Last active September 27, 2019 17:31
nicktoons speedrun notes

Notes about Nicktoons Solo% WR 2019-9-16

General

  • Using Danny for floor movement more often is ideal. Though after Tim1, football jimmy might save time (power hungry though).

Dan1

  • Nice door clip in Dan1 by jumping into the right side
  • My OOB is kind of loose, possible optimization.
  • Right side of bench is easier to clip?
  • We don’t really know where the end trigger is. Level viewer 2.0 incoming. If you got the old maps, throw them at me.
@44100hertz
44100hertz / 256.pest
Created January 16, 2019 19:38
arch256 syntax
asmfile = @{SOI ~ block ~ EOI}
block = @{(line ~ NEWLINE)* ~ line?}
WHITESPACE = _{(" " | "\t")+}
line = !{ label? ~ (instr | sexpr)? ~ comment? }
label = @{ ident ~ ":" }
instr = !{ opcode ~ (argument ~ ","?)* }
sexpr = !{ "(" ~ expr* ~ ")" }
fn triples() -> impl Iterator<Item=(u32, u32, u32)> {
let (mut x, mut y, mut z) = (1, 1, 1);
(0..).map(move |_| {
loop {
y += 1;
if y > z {
x += 1;
y = x;
}
if x > z {
@44100hertz
44100hertz / pocasm.js
Created October 24, 2018 23:51
WIP assembler
const fs = require ('fs');
const identify = (str) => [
['newline',/^(\r?\n|,)$/],
['comment',/^;[^\n]*$/],
['incomplete_quote', /^"([^"]*)$/],
['quote', /^"(.*)"$/],
['white', /^[\t ]+$/],
['num', /^([\d_]+)$/],
['ident', /^([a-z-+*/][\w-+*/]*)$/],
@44100hertz
44100hertz / fm_mml.rs
Created June 7, 2018 20:49
mml -> fm synth
const SRATE: u16 = 48000;
use std::f64::consts::PI;
use std::io::{Read, Write, stdin, stdout};
fn main() {
let sin_table: Vec<u8> = (0..256)
.map(|i| ((i as f64 / 512.0 / PI).sin() * 256.0) as u8)
.collect();
let get_sin = |phase: u16| -> i16 {
let pos = (phase >> 6) as u8 as usize;
let samp = sin_table[if phase & 1<<14 == 0 { pos } else { 0xff - pos }];