Skip to content

Instantly share code, notes, and snippets.

View anotherjesse's full-sized avatar

Jesse Andrews anotherjesse

View GitHub Profile
@anotherjesse
anotherjesse / TodoMVC.svelte
Created January 17, 2021 06:26
automerge custom store svelte todos
<script>
import {datastore} from './data.js';
const ENTER_KEY = 13;
const ESCAPE_KEY = 27;
let currentFilter = 'all';
let items = [];
let editing = null;
datastore.subscribe(db => {
import {writable} from 'svelte/store';
import Automerge from 'automerge';
if (typeof trikeQuit !== 'undefined' || trikeQuit !== null) {
document.addEventListener('keypress', e => {
if (e.metaKey && e.key === 'q') {
trikeQuit();
}
});
}
@anotherjesse
anotherjesse / tractor-todos-sqlite.go
Last active January 3, 2021 00:55
exploring sqlite3 + tractor engine
package main
import (
"database/sql"
"embed"
"log"
"github.com/manifold/tractor/toolkit/engine"
"github.com/mattn/go-sqlite3"
)
@anotherjesse
anotherjesse / Export_201215_215417.svg
Created December 15, 2020 21:56
rings and strings - glowforge + paperjs
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 })
}