Skip to content

Instantly share code, notes, and snippets.

View jshaw's full-sized avatar
🤖
👨‍🎨 👨‍💻

Jordan Shaw jshaw

🤖
👨‍🎨 👨‍💻
View GitHub Profile
@jshaw
jshaw / p5js_video_snippet.js
Created December 12, 2021 22:56
snippet for interpreting, manipulating and displaying video
if(label == "Start"){
flippedVideo.loadPixels();
noStroke();
for (let y = 0; y < flippedVideo.height; y += 8) {
for (let x = 0; x < flippedVideo.width; x += 8) {
let offset = ((y*flippedVideo.width)+x)*4;
fill(flippedVideo.pixels[offset],
flippedVideo.pixels[offset+1],
flippedVideo.pixels[offset+2]);
rect(x, y, 8, 8);
@jshaw
jshaw / snippetfile2.json
Created September 14, 2020 18:26
Example marketing payload, only email
{
email: "email@gmail.com"
}
@jshaw
jshaw / snippetfile1.json
Last active December 17, 2020 01:43
Example marketing payload Optional fields: * api_key * legal array
{
email: "email@gmail.com"
}
@jshaw
jshaw / GLSL-Noise.md
Created May 30, 2019 18:39 — 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);
}
@jshaw
jshaw / about.md
Created February 14, 2019 16:57 — forked from mattdesl/about.md
A Browser and Node.js compatible canvas-sketch script for generative and parametric 3D geometry.

Generative Geometry in Browser + Node.js

Here is a script that can be run with canvas-sketch to generate OBJ files from a parametric/algorithmic 3D ThreeJS geometry.

Hitting "Cmd + S" from the canvas-sketch tool will export a PNG and OBJ file of the scene.

If the same script is run from Node, it will simply render the OBJ to stdout, or write to the filename argument if given.

@jshaw
jshaw / .bash_profile
Created February 13, 2019 14:23 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@jshaw
jshaw / aframe-autoplay-video-on-mobile.js
Created October 25, 2017 20:08 — forked from cvan/aframe-autoplay-video-on-mobile.js
handle autoplay of <video> in A-Frame on mobile (iOS, Android) - see https://github.com/aframevr/aframe/pull/2657/files
function playVideoOnClick (selector) {
el = document.querySelector(selector);
if (el) {
addListener();
} else {
window.addEventListener('load', addListener);
}
function addListener () {
@jshaw
jshaw / smoothing.ino
Last active February 19, 2017 04:40
Arduino Smoothing algorithm
// taken from https://github.com/arduino/Arduino/issues/3934
// its an alternative to: https://www.arduino.cc/en/Tutorial/Smoothing
const int filterWeight = 4; // higher numbers = heavier filtering
const int numReadings = 10;
int average = 0; // the average
void setup() {
// initialize serial communication with computer:
@jshaw
jshaw / json_export_2_csv.js
Last active September 14, 2016 22:09
JSON import + Export CSV for friend
var json2csv = require('json2csv');
var jsonfile = require('jsonfile');
var fs = require('fs');
var fields = ['Body', 'DateCreated', 'timestamp'];
var file = './jsontest_edit.json';
var import_json = "";
jsonfile.readFile(file, function(err, obj) {
console.dir(obj);
import_json = obj;
@jshaw
jshaw / photon_subscribe_example.ino
Created November 23, 2015 19:31
photon_subscribe_example
int ledPin = D2;
int ledPin7 = D7;
int newLike = 0;
int locationChange = 0;
int i = 0;
unsigned long previousTime;
int interval = 5000;