Skip to content

Instantly share code, notes, and snippets.

View ChristopherJohnston's full-sized avatar

Chris Johnston ChristopherJohnston

View GitHub Profile

Keybase proof

I hereby claim:

  • I am christopherjohnston on github.
  • I am chris_johnston (https://keybase.io/chris_johnston) on keybase.
  • I have a public key whose fingerprint is B57F A904 610D 66B7 93DD 97F2 4135 3612 51E0 62E5

To claim this, I am signing this object:

@ChristopherJohnston
ChristopherJohnston / block.py
Created December 21, 2017 01:07
Example Blockchain hash calculations using Python
from hashlib import sha256
import time
import struct
import binascii
import datetime
VERSION = 1
def hexify(value, type):
return binascii.hexlify(struct.Struct(type).pack(value))
@ChristopherJohnston
ChristopherJohnston / import.ts
Created February 26, 2024 13:24
Split import from splitwise
import { getPrisma } from '@/lib/prisma'
import { Prisma } from '@prisma/client'
import { randomId, getCategories } from '@/lib/api'
import { Client } from 'pg'
import { default as csv } from 'csv-parser'
import { createReadStream } from 'fs'
async function writeData(groupName: string, currency: string, data: any) {
const prisma = await getPrisma()
@ChristopherJohnston
ChristopherJohnston / main.dart
Last active September 16, 2024 10:06
MOTU AVB Controller App Settings Encoding
import 'dart:convert';
final settingsJson = {
//"deviceUrl": "http://localhost:8888/datastore",
"deviceUrl": "https://motu-avb-server.web.app/datastore",
"auxList": [0, 2, 4, 6, 8, 10, 12],
"groupList": [0, 2, 4],
"groupInputList": {
"0": [24, 25, 26, 27, 28, 29, 30, 31, 32, 34],
"2": [],