Skip to content

Instantly share code, notes, and snippets.

View anotherjesse's full-sized avatar

Jesse Andrews anotherjesse

View GitHub Profile
const width=600,
height=800,
radius=50;
const cos = degrees => Math.cos((degrees / 180.0) * Math.PI)
const sin = degrees => Math.sin((degrees / 180.0) * Math.PI)
function addCircle(x,y,r,color) {
const c = new Path.Circle(new Point(x,y), r);
c.strokeColor = color;
function smoother(path) {
var geometric = false;
for (var factor=0.1; factor < 2.0; factor += 0.1) {
var np = path.clone()
np.smooth({type: geometric ? 'geometric' : 'catmull-rom', factor: factor})
np.position.y += factor * 10
}
}
@anotherjesse
anotherjesse / paper-opart.js
Created September 14, 2019 15:37
paperjs opart
const lerp = (min, max, percentage) => min + (max - min) * percentage;
const boxer = points => {
const p = new paper.Path();
p.strokeColor = 'purple';
p.add(points[points.length - 1]);
points.forEach(point => p.add(point));
let iters = 50;
@anotherjesse
anotherjesse / laser.js
Last active September 4, 2019 04:47
makeblock laserbot javascript poc
// prototype code to control the makeblock laserbot via javascript
//
// WARNING: this is a demo, do not use unless you know what it is doing, even then, probably don't use it!
//
// gcode spec from https://forum.makeblock.com/t/faqs-for-the-makeblock-laserbot/7329
var SerialPort = require('serialport');
const Readline = require('@serialport/parser-readline');
const connect = function({path, baudRate}) {
var width, height, center;
var points = 10;
var smooth = true;
initializePath(500, 100, 200);
function initializePath(num_rays, radius, length) {
center = view.center;
width = view.size.width;
height = view.size.height/2;
A.PT#9{i8vCMKb8ncZUibDqVePUZpFvLjBtUAfoKRzxbe4jvuV
function smoother(path) {
var geometric = false;
for (var factor=0.1; factor < 4.0; factor += 0.1) {
var np = path.clone()
np.smooth({type: geometric ? 'geometric' : 'catmull-rom', factor: factor})
np.position.y += factor * 10
}
}
import skimage
import uuid
import sys
import numpy as np
colors = [
[92, 148, 252],
[0,0,0],
[32, 56, 236]
@anotherjesse
anotherjesse / wrong.js
Created September 13, 2018 02:22
a bad approach to using 3d noise to generate looping 2d animated gif
// this works, but the right side is much more dynamic as it rotates through the space.
// the idea here was taking golan's https://twitter.com/anotherjesse/status/1040007965799997440 or https://editor.p5js.org/full/BJLbRp8dm
// and using the 3d dimension of noise for adding another dimension to noise (I think this works)
// but then modifying the radius of the noise to add a 3rd dimension
let myScale = 0.01,
radius = 100.0,
nSteps = 360,
width = 600,
height = 600,
@anotherjesse
anotherjesse / netgear.py
Created August 8, 2017 02:59
I forgot my netgear password
import requests
import random
import sys
chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()-_+=;:'
tries = 0
while True:
if tries % 1000 == 0: print tries
tries += 1