Skip to content

Instantly share code, notes, and snippets.

View anotherjesse's full-sized avatar

Jesse Andrews anotherjesse

View GitHub Profile
@anotherjesse
anotherjesse / Export_201215_215417.svg
Created December 15, 2020 21:56
rings and strings - glowforge + paperjs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@anotherjesse
anotherjesse / dat-store-sync-tool.js
Created December 6, 2020 18:02
gets list of files in /sync folder of hyperdrive, files that are 64 chars are added to dat-store
const http = require('http');
const { exec } = require("child_process");
const util = require('util');
// const primary = '64 character key here'
const adder = (url) => {
exec(`node bin.js add ${url}`)
}
@anotherjesse
anotherjesse / microbit-microjoust.js
Created June 8, 2020 18:27
microbit microjoust
input.onButtonPressed(Button.A, function () {
radio.sendValue("ready", control.deviceSerialNumber())
markReadyDevice(control.deviceSerialNumber())
})
input.onButtonPressed(Button.B, function () {
radio.sendValue("ensure", control.deviceSerialNumber())
basic.showNumber(devices.length)
})
radio.onReceivedString(function (receivedString) {
if (receivedString == "restart") {
@anotherjesse
anotherjesse / node downloader of faves
Created February 28, 2020 04:20
twitter-faves.js
const fs = require('fs');
var Twitter = require('twitter');
const dest = 'faves';
var client = new Twitter({
consumer_key: '',
consumer_secret: '',
access_token_key: '',
access_token_secret: '',
});
Pin(2, Pin.OUT).value(0) # value(1)
turns on and off the built in blue LED on the esp8266 nodemcu amica
# This file is executed on every boot (including wake-boot from deepsleep)
#import esp
# esp.osdebug(None)
import web
import bunny
import uos
import machine
# uos.dupterm(None, 1) # disable REPL on UART(0)
import gc
import webrepl
const boardId = 'FIXME'
const { Repo } = require('hypermerge')
const Hyperswarm = require('hyperswarm')
const uuid = require('uuid/v4')
function myRepos(dbName) {
return new Repo({ memory: true })
}
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;