Skip to content

Instantly share code, notes, and snippets.

@zer0TF
zer0TF / convert_to_safe.py
Created November 28, 2022 04:53
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
// Unity C# Cheat Sheet
// I made these examples for students with prior exerience working with C# and Unity.
// Too much? Try Unity's very good tutorials to get up to speed: https://unity3d.com/learn/tutorials/topics/scripting
@983
983 / frag.glsl
Created November 14, 2015 09:39
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;
@ericelliott
ericelliott / essential-javascript-links.md
Last active May 17, 2024 03:38
Essential JavaScript Links
@fhinson
fhinson / iologo.svg
Last active January 30, 2021 07:42
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
@jvcleave
jvcleave / gist:a9e8d7cee4cdd74fb5b1
Last active August 29, 2015 14:03
Jetson TK1 OF 0.8.3 diff
Only in openFrameworks/apps/myApps/emptyExample: bin
Only in openFrameworks/apps/myApps/emptyExample: obj
Only in openFrameworks/examples/utils/conversionExample/bin: conversionExample
Only in openFrameworks/examples/utils/conversionExample/bin: conversionExample_debug
Only in openFrameworks/examples/utils/conversionExample/bin: libs
Only in openFrameworks/examples/utils/conversionExample/bin: readMe.txt
Only in openFrameworks/examples/utils/conversionExample: obj
Only in openFrameworks/examples/utils/fileOpenSaveDialogExample: obj
Only in openFrameworks/examples/utils/windowExample/bin: libs
Only in openFrameworks/examples/utils/windowExample/bin: readMe.txt
@jvcleave
jvcleave / Makefile
Created July 9, 2014 18:43
Nvidia simpleGL for CUDA Jetson (from ~/NVIDIA_CUDA-6.0_Samples/2_Graphics/simpleGL)
################################################################################
#
# Copyright 1993-2013 NVIDIA Corporation. All rights reserved.
#
# NOTICE TO USER:
#
# This source code is subject to NVIDIA ownership rights under U.S. and
# international Copyright laws.
#
# NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active May 19, 2024 07:09
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

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);