Skip to content

Instantly share code, notes, and snippets.

View donnaken15's full-sized avatar
🌲
PINE GANG 2⃣1⃣⛷💨😝😱😭💾💾😉📠♿️😇😬😄🔥🔥🔥🙌🌚

Wesley donnaken15

🌲
PINE GANG 2⃣1⃣⛷💨😝😱😭💾💾😉📠♿️😇😬😄🔥🔥🔥🙌🌚
View GitHub Profile
@donnaken15
donnaken15 / prime64_M_rs.asm
Last active April 11, 2024 16:12
further optimized prime counter with reordered code to avoid register stall (actually working :O) and check and compare square root of current number
format PE64 console 3.1
entry @f
include 'win64a.inc'
MAX_ITERATIONS = 100000000
section '' import code data \
@donnaken15
donnaken15 / dedupe
Last active April 5, 2024 14:53
Group duplicates of files into hardlinks, check using SHA256 and matching file size
#!/bin/zsh
[ $# -eq 1 ] && {
echo you must specify more than one file to be deduped
echo
}
[ $# -lt 2 ] && {
echo "dedupe [input files]"
echo "- replace multiple unchanging"
echo copies of the same files with
echo hardlinks to save space
@donnaken15
donnaken15 / prime64_M.asm
Created April 3, 2024 06:38
FASM: further optimized prime number counter using array that expands with each prime number found, to not waste extra division ops (i.e. don't % 9, 15, 21, 25, 27, etc)
format PE64 console 3.1
entry @f
include 'win64a.inc'
MAX_ITERATIONS = 100000000
; 1kb EXE 1337
@donnaken15
donnaken15 / prime_ARM.asm
Last active March 17, 2024 09:18
Prime number counter in ARM assembly, based on 2018-2020 code
; wesley's prime number check in ARM
mov r0, #5 ; i
loop mov r1, #3 ; j
check mov r2, r0 ; modulo (cheap)
modl sub r2, r2, r1
cmp r2, r1
bhs modl ; r2 > r1
cmp r2, #0 ; == 0
beq fail ; then not prime
; continue
@donnaken15
donnaken15 / pakdir.cs
Created February 24, 2024 07:13
pakdir, before hardcore EXE optimization
/*
* Created by SharpDevelop.
* User: Wesley
* Date: 2/21/2024
* Time: 3:55 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.IO;
@donnaken15
donnaken15 / perftest.sh
Created November 25, 2023 05:29
Updated FastGH3 audio encoding speed test shell scripts (requires sox, helix, ffmpeg) (put in music/tools folder)
if [ ! "$(dirname "$0")" = "." ]; then
here=$(realpath "$0")/
else
here=$(which "$0")/
fi
here=$(dirname "$here")
TIMEFORMAT=%R
LPARAMS="--cbr -b 128 --resample 44100 -m j"
@donnaken15
donnaken15 / dadabots_tape
Created November 24, 2023 10:19
Tape currently broadcasting neural mathcore
#!/bin/sh
echo Current time: $(date +"%F %H:%M:S")
echo Hit Ctrl+C to stop taping.
AUDIO_FORMAT=233
STREAM_URL=MwtVkPKx3RA
M3U=$(ytdl -f $AUDIO_FORMAT -g "${STREAM_URL}")
SAMPRATE=16000
#BITRATE=80000 -ab ${BITRATE}
ffmpeg -i "${M3U}" -ac 1 -ar ${SAMPRATE} -q 7 -loglevel warning -hide_banner DADABOTS_TAPE_$(date +%F_%H_%M_%S.%N).ogg
\[prc_((intro_(slow|fast|heavy|verse|chorus)|fade_(in|out)|(alt_|quiet_)verse)(_[a-d])?|(quiet|noise|drum|bass|vocal|gtr|violin|strings|orch|horn|harmonica|organ|piano|keyboard|dj)_intro(_[a-d])?|(pre|post)?((verse|chorus|main|gtr|bass|big(ger)?|heavy|fast|slow|swing|chunky|odd)_riff|verse|chorus|bridge|interlude|soundscape|(space_)?jam|vamp|(build|speed)_up|tension|release|crescendo|((lo|hi)_)?melody|(verse|chorus))(_[1-9]?[a-f]?)?|(intro|(pre|post)?verse|chorus(_break)?|(pre|post)?chorus|((breakdown|alt)_)chorus|bridge)(_[a-f])?|(drums_enter|(bass|gtr|rhy|band|syth|keyb|organ|piano)_enters)|((break(down)?)|((gtr|slide|drum|perc|bass|organ|piano|keyboard|synth|harmonica|sax|horn|flute|noise|dj|vocal)_)?(solo|break)|hook|drum_roll|gtr_(lead|fill|hook|melody|line|lick)|oohs|prayer|chant|spoken_word|outro(_(solo|chorus))?|ending)(_[1-9]?[a-s]?)?|((slow|fast|quiet|loud|heavy|spacey|trippy)_)?part(_[1-4]?[a-d]?)?|spacey|sctrach_break|ah|yeah|bre|intro_slow_1|kick_it|[a-k][1-9]?)\]
@donnaken15
donnaken15 / ffprobe_shell.reg
Created October 16, 2023 05:34
ffprobe context menu
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\FFProbe]
@="Probe Media..."
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\*\shell\FFProbe\command]
@="cmd /c mode con cols=80 lines=20 && title ffprobe&& ffprobe -hide_banner -i \"%1\" & pause"
@donnaken15
donnaken15 / typecheck.js
Last active October 11, 2023 23:37
object type checking with recursion
// checks if an object's data is symmetric with a struct with defining types
function typecheck(object, types, optional=null) {
// TODO: optional error print, showing
// where in the object did this function fail
// if that's even possible
//
// example:
// typecheck({
// "thing": 1,
// "thing2": "2",