Skip to content

Instantly share code, notes, and snippets.

View jazzyjackson's full-sized avatar

Colten Jackson jazzyjackson

View GitHub Profile
jazzyjackson /
Created October 25, 2023 20:44
Modified Nunchuk Class
import machine
import time
import utime
class Nunchuk(object):
"""The Nunchuk object presents the sensor readings in a polling way.
Based on the fact that the controller does communicate using I2C we
cannot make it push sensor changes by using interrupts or similar
facilities. Instead a polling mechanism is implemented, which updates
the sensor readings based on "intent-driven" regular updates.
jazzyjackson /
Last active June 15, 2023 22:41
python MITM for holochaining
import asyncio
import websockets
from http.server import HTTPServer, SimpleHTTPRequestHandler
from socketserver import ThreadingMixIn
myip = b''
def replace_localhost(data):
return data.replace(b'localhost', myip)
jazzyjackson / main.js
Created April 24, 2023 05:51
// This function will scrape all the conversations from the chatorg website
// It will return an array of arrays, the outer array is of all conversation
// the inner array is a list of message pairs
// grab all anchors
// advance to the next anchor
// pull the current chat history
import asyncio
from fastapi import FastAPI, WebSocket
from fastapi.responses import FileResponse
from fastapi.staticfiles import StaticFiles
import os
import websockets
app = FastAPI()
# Mount the static files in the storage/node_modules/gun directory under the /gun path
jazzyjackson /
Created April 22, 2021 21:42 — forked from JosePedroDias/
mitmproxy CORS
# based on
# mitmproxy -s
# mitmdump -s
from mitmproxy import http
def response(flow):
h = flow.request.headers
# a blender-python script that generates a normal distribution of cubes and ico-spheres
# then animates a subset of the objects, levitating a few objects into a line to the left and a few to the right
import bpy, numpy
from mathutils import *
radius = 30
n_samples = 50
samples = numpy.random.multivariate_normal([-0.5, -0.5], [[radius, 0],[0, radius]], n_samples) #returns an array of arrays
.map((e, i, a) => i && a[i] - a[i - 1])
.filter(n => n > 0)
// 1527
// create a new array, then scan the input, adding each element to its coresponding index and the next two indexes as well
// is the number of additions any different than looking ahead and behind for each of them?
// for 1st strategy, for each element, I read 3 and write once.
Windows Registry Editor Version 5.00
; credit to
; The hex data is in five groups of four bytes:
; 00,00,00,00,\ header version (always 00000000)
; 00,00,00,00,\ header flags (always 00000000)
; 04,00,00,00,\ # of entries (3 in this case) plus a NULL terminator line.
; Entries are in 2-byte pairs: Key code to send & keyboard key to send it.
; Each entry is in "least significant byte, most significant byte" order,
; e.g. 0x1234 becomes `34,12`
; 1d,00,3a,00,\ Send LEFT CTRL (0x001d) code when user presses the CAPS LOCK key (0x003a)
function printOurSailor(allPublicKeys, candidatesSeed){
for(var candidateSeed of candidatesSeed){
let keychain = this.CryptoService.mnemonicToKeychain(candidateSeed)
let seedHex = this.CryptoService.keychainToSeedHex(keychain)
let privateKey = this.CryptoService.seedHexToPrivateKey(seedHex)
let publicKey = this.CryptoService.privateKeyToBitcloutPublicKey(privateKey, "mainnet")
console.log("Our sailor is" + publicKey + " mnemonic: " + candidateSeed)