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);
}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# local port forwarding | |
# the target host 192.168.0.100 is running a service on port 8888 | |
# and you want that service available on the localhost port 7777 | |
ssh -L 7777:localhost:8888 user@192.168.0.100 | |
# remote port forwarding | |
# you are running a service on localhost port 9999 | |
# and you want that service available on the target host 192.168.0.100 port 12340 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vec4 pack (float depth) | |
{ | |
const vec4 bitSh = vec4(256 * 256 * 256, | |
256 * 256, | |
256, | |
1.0); | |
const vec4 bitMsk = vec4(0, | |
1.0 / 256.0, | |
1.0 / 256.0, | |
1.0 / 256.0); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
the | |
of | |
to | |
and | |
a | |
in | |
is | |
it | |
you | |
that |
NewerOlder