Skip to content

Instantly share code, notes, and snippets.

@billautomata
billautomata / convert_to_safe.py
Created December 12, 2022 06:59 — forked from zer0TF/convert_to_safe.py
Convert all CKPT files to SAFETENSOR files in a directory
# Got a bunch of .ckpt files to convert?
# Here's a handy script to take care of all that for you!
# Original .ckpt files are not touched!
# Make sure you have enough disk space! You are going to DOUBLE the size of your models folder!
#
# First, run:
# pip install torch torchsde==0.2.5 safetensors==0.2.5
#
# Place this file in the **SAME DIRECTORY** as all of your .ckpt files, open a command prompt for that folder, and run:
# python convert_to_safe.py
@billautomata
billautomata / frag.glsl
Created February 7, 2022 17:13 — forked from 983/frag.glsl
hsv rgb conversion glsl shader
// because http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl is often down
vec3 rgb2hsv(vec3 c)
{
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
float d = q.x - min(q.w, q.y);
float e = 1.0e-10;
@billautomata
billautomata / GLSL-Noise.md
Created January 14, 2022 18:29 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
	return mix(rand(fl), rand(fl + 1.0), fc);
}
@billautomata
billautomata / ca.md
Created December 15, 2019 08:17 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@billautomata
billautomata / midi-computer-test.c
Created May 23, 2019 15:47
midi clock and 16th notes test program
unsigned long BPM = 120;
unsigned long PPQ = 24;
unsigned long PPQ_T;
unsigned long SECONDS_IN_MINUTE = 60;
unsigned long MICROSECONDS_PER_PPQ = (SECONDS_IN_MINUTE * 1000000) / (BPM * PPQ);
unsigned long _micros;
unsigned long MICROSECONDS_PER_STEP = (SECONDS_IN_MINUTE * 1000000) / (BPM * 4);
unsigned long STEP_T;
@billautomata
billautomata / example.js
Created August 28, 2018 01:46
dealing with callbacks
// nest them
var a = 0
var b = 0
fs.readFile('filename.txt', function(err,data){
a = data
fs.readFile('file2.txt', function(err,data){
b = data
console.log(a,b) // both values
@billautomata
billautomata / 1-1000.txt
Created November 24, 2016 23:19 — forked from deekayen/1-1000.txt
1,000 most common US English words
the
of
to
and
a
in
is
it
you
that
@billautomata
billautomata / SMBDIS.ASM
Created October 20, 2016 12:46 — forked from 1wErt3r/SMBDIS.ASM
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@billautomata
billautomata / mencoder_for_iphone.sh
Created June 3, 2016 17:57
mencoder for iphone
mencoder output.avi -o yup.mp4 \
-of lavf -lavfopts format=mp4 -ovc x264 -sws 9 \
-x264encopts nocabac:level_idc=30:bframes=0:bitrate=512:threads=auto:turbo=1:global_header:threads=auto:subq=5:frameref=6:partitions=all:trellis=1:chroma_me:me=umh
@billautomata
billautomata / .block
Created May 23, 2016 00:50 — forked from mbostock/.block
Force-Directed Graph
license: gpl-3.0