Skip to content

Instantly share code, notes, and snippets.

@golanlevin
golanlevin / sketch.js
Created September 30, 2018 01:43
PoseNet skeletons with ml5.js & p5.js, using a pre-loaded video
// Copyright (c) 2018 ml5
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
/* ===
ml5 Example
PoseNet example using p5.js
=== */
@golanlevin
golanlevin / tezos-attestation.txt
Created October 31, 2021 23:56
Public Tez Attestation
I am attesting that this GitHub handle golanlevin is linked to the Tezos account tz1eQThmh9yuuxjvFBWbRGKUr2goUw1gAd39 for tzprofiles
sig:edsigtfpkYT5uWCuWwLFnRQ5xvhgGkcZ14fwFCUXNVFWuzq9BYi1aQChcxws83YZFS2e9QerSXu6VA8s9D5wHioSCFiYEuwC5GC
@golanlevin
golanlevin / concave_hull.pde
Last active September 28, 2021 22:46
Concave Hull in Processing
/**
* concave_hull.pde -- THIS VERSION IS FOR PROCESSING 4
* by Udo Schlegel - Udo.3.Schlegel(at)uni-konstanz.de
* Ported to Processing v4 by Golan Levin and Aren Davey
* This is an implementation of the algorithm described by Adriano Moreira and Maribel Yasmina Santos:
* CONCAVE HULL: A K-NEAREST NEIGHBOURS APPROACH FOR THE COMPUTATION OF THE REGION OCCUPIED BY A SET OF POINTS.
* GRAPP 2007 - International Conference on Computer Graphics Theory and Applications; pp 61-68.
* https://repositorium.sdum.uminho.pt/bitstream/1822/6429/1/ConcaveHull_ACM_MYS.pdf
* With help from https://github.com/detlevn/QGIS-ConcaveHull-Plugin/blob/master/concavehull.py
*/
@golanlevin
golanlevin / modulo_example.js
Created October 24, 2017 15:04
Modulo Example from Golan's Coding Train
var nElements = 7;
var myCounter = 0;
var ping = 0;
function setup() {
createCanvas(600, 500);
}
function draw() {
background((255*(1-(ping*=0.95))), 255,255);
@golanlevin
golanlevin / convertZoomCaptionsToWebVTT.pde
Last active May 17, 2021 15:19
Utility for converting transcriptions produced by Zoom's speech-to-text, into WebVTT Caption files suitable for Vimeo.
// Utility for converting transcriptions produced by Zoom's speech-to-text,
// into WebVTT Caption files suitable for Vimeo.
/*
Zoom transcription file looks like:
17:32:36 Thanks so much. Hi everybody, let me get my screen share going.
17:32:47 Right.
----------------------
@golanlevin
golanlevin / shaderHelloWorld.frag
Created May 5, 2021 02:48
Simple Processing Shader Template
#ifdef GL_ES
precision mediump float;
#endif
#define PROCESSING_COLOR_SHADER
uniform vec2 u_resolution;
uniform vec2 u_mouse;
uniform float u_time;
// Quick-and-dirty Processing v.3.5.4 program to render the Amiga Kickstart vector art, as described here:
// https://retrocomputing.stackexchange.com/questions/13897/why-was-the-kickstart-1-x-insert-floppy-graphic-so-bad
// Note: this program ignores the flood fills and colors.
// Processing program by Golan Levin, 4/1/2021.
// Amiga artwork by Sheryl Knowles.
void setup() {
/*
* Rendering algorithm:
@golanlevin
golanlevin / ScrapingWorkshop1
Created March 8, 2015 23:19
Scraping Workshop by Golan
Ben Fry on the Infovis Pipeline:
http://golancourses.net/2014/wp-content/uploads/2014/01/Screen-Shot-2014-01-23-at-6.43.44-AM-620x608.png
Some Options for Scraping:
Temboo: https://temboo.com/library/
Kimono Labs: http://www.kimonolabs.com/
Beautiful Soup: http://www.crummy.com/software/BeautifulSoup/bs4/doc/
Processing (XML, JSON)
@golanlevin
golanlevin / noiseloop.pde
Last active October 19, 2020 13:12
Processing code to demonstrate seamless loop of 1D noise
// Processing 3.0x code to demonstrate seamless loop of 1D noise
// Inspired by, and created in support of:
// "Drawing from noise, and then making animated loopy GIFs from there" by Etienne Jacob (@n_disorder)
// https://necessarydisorder.wordpress.com/2017/11/15/drawing-from-noise-and-then-making-animated-loopy-gifs-from-there/
// Note: this program has no dependencies, and does not require SimplexNoise.
// Demo GIF: https://media.giphy.com/media/xUOxeU2ELSPeTbevle/giphy.gif or http://gph.is/2Ah5kqG
PGraphics offscreenImg;
float myScale = 0.01;
float radius = 100.0;
@golanlevin
golanlevin / palmsynth.pde
Last active October 19, 2020 13:12
Palm synth
// https://imgur.com/a/ZEE2f
final color wristCol = color(255, 0, 255);
final color palmCol = color(127);
final color thumbCol = color(0, 255, 0);
final color finger1Col = color(255, 0, 0);
final color finger2Col = color(0, 0, 255);
final color finger3Col = color(0, 255, 255);
final color finger4Col = color(255, 255, 0);
color fingerColors[] = {