Skip to content

Instantly share code, notes, and snippets.

Jordan Shaw jshaw

Block or report user

Report or block jshaw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jshaw
jshaw / GLSL-Noise.md
Created May 30, 2019 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms
View GLSL-Noise.md

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 Feb 14, 2019 — forked from mattdesl/about.md
A Browser and Node.js compatible canvas-sketch script for generative and parametric 3D geometry.
View about.md

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 Feb 13, 2019 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
View .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
View aframe-autoplay-video-on-mobile.js
function playVideoOnClick (selector) {
el = document.querySelector(selector);
if (el) {
addListener();
} else {
window.addEventListener('load', addListener);
}
function addListener () {
@jshaw
jshaw / smoothing.ino
Last active Feb 19, 2017
Arduino Smoothing algorithm
View smoothing.ino
// 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 Sep 14, 2016
JSON import + Export CSV for friend
View json_export_2_csv.js
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;
View photon_subscribe_example.ino
int ledPin = D2;
int ledPin7 = D7;
int newLike = 0;
int locationChange = 0;
int i = 0;
unsigned long previousTime;
int interval = 5000;
@jshaw
jshaw / particle_iceland_bike_example
Created Nov 20, 2015
particle iceland bike example
View particle_iceland_bike_example
// http://apis.is/cyclecounter
// particle webhook GET ice_bikes "http://apis.is/cyclecounter"
// Jordans-MacBook-Pro:~ jshaw$ particle webhook GET ice_bikes "http://apis.is/cyclecounter"
// Sending webhook request { uri: 'https://api.particle.io/v1/webhooks',
// method: 'POST',
// json:
// { event: 'ice_bikes',
// url: 'http://apis.is/cyclecounter',
// deviceid: undefined,
@jshaw
jshaw / index.html
Created Feb 20, 2015
Google Streetview Example
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Custom Street View panorama tiles</title>
<meta charset="utf-8">
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px
View heapsort.js
var list = [9,1,7,3,4,2,8,0,5,6];
function chunk(list) {
var chunks = [];
for(var i=0; i<list.length; i++) {
if(list.length % 2 == 1 && i+1 == list.length) {
chunks.push(list[i]);
} else {
if(i % 2 == 0) {
chunks.push(Math.max(list[i], list[i+1]));
You can’t perform that action at this time.