Skip to content

Instantly share code, notes, and snippets.

View saltyJeff's full-sized avatar
🏠
Working from home

saltyJeff saltyJeff

🏠
Working from home
  • UCLA
  • Los Angeles
View GitHub Profile
@saltyJeff
saltyJeff / squeeze_imgs.py
Last active June 25, 2022 00:26
Utility function that squeezes many images into one
"""
To use this library, make sure you have the following pip libraries installed:
- tifffile
- imagecodecs
"""
from os import PathLike
import os
import tifffile as tiff
import numpy as np
@saltyJeff
saltyJeff / README.md
Created April 11, 2022 04:16
Typescript Event Emitter

Typescript EventEmitter

A browser implementation of the event emitter, with a split between listenable events and emittable events

@saltyJeff
saltyJeff / design.md
Last active November 29, 2021 22:51
a hypothetical OS design

saltyJeff's Hypothetical OS Design

Background

An OS kernel can be thought of many interacting hardware abstractions, or drivers. For example, an OS kernel has a timestamp driver that abstracts away the process of reading from a hardware clock, and a filesystem driver that communicates with the timestamp driver to accurately timestamp file modification times.

In a monolithic operating system, drivers are statically linked, so all interactions are just method calls. In a microkernel however, driver interactions look like this:

TODO: copy a example

Problem

Users are forced to make security decisions at OS-adoption time. If I have 100 drivers that I trust

@saltyJeff
saltyJeff / game.txt
Created February 20, 2021 11:54
A game
init state
@saltyJeff
saltyJeff / bootloader.elf.dump
Created January 3, 2021 10:49
arduinio mbed bootloader
bootloader.elf: file format elf32-littlearm
Disassembly of section text:
00000000 <_vector_table>:
0: 20008d48 .word 0x20008d48
4: 00003ef9 .word 0x00003ef9
8: 00007001 .word 0x00007001
@saltyJeff
saltyJeff / main.c
Created January 3, 2021 10:26
Arduino nano ble 33 I2C tester
/* This file contains a demonstration of the
* I2C capabilities of the zephyr port of the
* Arduino Nano BLE 33
*/
#include <zephyr.h>
#include <devicetree.h>
#include <drivers/i2c.h>
#include <usb/usb_device.h>
int main()
@saltyJeff
saltyJeff / pendulum_ultrasound.csv
Created May 7, 2020 21:44
Pendulum Ultrasound Data
t x y
7.082133332999999809e+00 -1.420180815777884742e-01 -2.233093178999999984e-01
7.115455555999999682e+00 -6.571689286393291030e-02 -2.404072470999999989e-01
7.148766667000000297e+00 -3.114005277575879888e-02 -2.538783427999999898e-01
7.182077778000000023e+00 3.895770153200008024e-04 -2.616501287999999925e-01
7.215388888999999750e+00 2.011174439101593575e-02 -2.575051763000000271e-01
7.248700000000000365e+00 6.433572494850672840e-02 -2.497333902999999966e-01
7.282011111000000092e+00 2.230860302078150337e-01 -2.398891280000000070e-01
7.315322221999999819e+00 1.172279976850519601e-01 -2.290086275999999865e-01
7.348633333000000434e+00 2.063348291477769825e-01 -2.145012937000000119e-01
@saltyJeff
saltyJeff / spring_mass.csv
Last active May 5, 2020 21:36
4AL lab3 data
t x y
3.416666667E0 3.095767798E-3 -1.335402007E-1
3.458333333E0 3.732932602E-3 -1.341825423E-1
3.500000000E0 5.107329211E-3 -1.472930245E-1
3.541666667E0 4.493506630E-3 -1.630342690E-1
3.583333333E0 5.095872773E-3 -1.772071003E-1
3.625000000E0 5.867149178E-3 -1.926201340E-1
3.666666667E0 6.492195012E-3 -2.230393614E-1
3.708333333E0 6.642072471E-3 -2.352508603E-1
3.750000000E0 6.587794461E-3 -2.445836096E-1
@saltyJeff
saltyJeff / beat_this.txt
Last active March 12, 2020 07:58
Laptop Search Criteria
Processor:
8th+ generation
2-4 cores
RAM:
8+ GB
SSD:
128+ GB
@saltyJeff
saltyJeff / env.ts
Created September 20, 2019 22:12
static type dotenv
class EnvVars {
static = 'true'
loglevel = 'debug'
GOOGLE_APPLICATION_CREDENTIALS = './credentials.json'
GOOGLE_CLIENT_ID: string = 'not a valid id'
}
let cached = false
export function env(): EnvVars {
if(!cached) {
const defaults = new EnvVars()