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
// ported from https://www.shadertoy.com/view/4ttGWM | |
fn rand(n: vec2f) -> f32 { | |
return fract(sin(cos(dot(n, vec2f(12.9898,12.1414)))) * 83758.5453); | |
} | |
fn noise(n: vec2f) -> f32 { | |
const d = vec2f(0.0, 1.0); | |
var b = floor(n); | |
var f = smoothstep(vec2(0.0), vec2(1.0), fract(n)); | |
return mix(mix(rand(b), rand(b + d.yx), f.x), mix(rand(b + d.xy), rand(b + d.yy), f.x), f.y); |
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
#!/usr/bin/env python3 | |
import sys | |
import tempfile | |
from pathlib import Path | |
import subprocess | |
import os | |
import platform | |
scale = 1.0 |
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
#!/usr/bin/env python3 | |
import argparse | |
import tempfile | |
from pathlib import Path | |
import subprocess | |
import os | |
import platform | |
scale = 1.0 |
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
#!/usr/bin/env python3 | |
# Example: | |
# > cd /tmp | |
# extract_vocals.py '/Users/ypujante/Music/iTunes/iTunes Music/Music/Janet Jackson/Janet/08 This Time.m4a' | |
# Generates /tmp/08 This Time/vocals.wav and /tmp/08 This Time/accompaniment.wav | |
import argparse | |
import os | |
import subprocess |
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
#!/usr/bin/env bash | |
# Usage: tm-log.sh [last] | |
# last: displays up to "last" events before streaming. defaults to 1h (see --last option for log) | |
LAST=${1:-1h} | |
ARGS=( --info --predicate 'processImagePath contains "backupd" and subsystem beginswith "com.apple.TimeMachine"' ) | |
# Implementation note: tr -u and sed -l are required (nothing shown until buffer full otherwise!) |
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
#include <JukeboxTypes.h> | |
/** | |
Replace code like this: | |
TJBox_Value values[] = {noteCVValue, gateCVValue}; | |
JBOX_TRACEVALUES("Note CV ^0 Gate CV ^1 ", values, 2); | |
with |
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
// This is an example snippet code to post the content of a form to a rest api which | |
// then returns some json response using kotlin compiled (=transpiled) to javascript | |
// | |
// <form method="POST" action="<url to rest api which returns json>"> | |
// ...fields... | |
// <input type="button" id="my-submit-button" value="Click Me!"> | |
// </form> | |
import org.w3c.dom.HTMLInputElement | |
import org.w3c.xhr.FormData |
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
// ... build.gradle | |
// ... | |
def webFolder = new File(project.buildDir, "web") | |
// ... | |
task run(type: JavaExec, dependsOn: [jvmMainClasses, jsJar]) { | |
main = "sample.SampleJvmKt" | |
classpath { | |
[ |
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
#!/bin/bash | |
PORT=80 | |
WWW_DIR=`pwd` | |
############################################################################### | |
# | |
# Function Name : usage() | |
# Arguments : N/A | |
# Return Result : N/A, exit 0 |
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
import io.reactivex.Observable | |
import io.reactivex.schedulers.Schedulers | |
import io.reactivex.subjects.PublishSubject | |
import java.util.* | |
// see https://stackoverflow.com/questions/44634758/unexpected-behavior-with-rxjava2-publishsubject | |
fun withAutoConnect() { | |
val subject = PublishSubject.create<Int>() |
NewerOlder