Skip to content

Instantly share code, notes, and snippets.

View sachio222's full-sized avatar
🎯
Focusing

Jake Krajewski sachio222

🎯
Focusing
View GitHub Profile
@gullinbursti
gullinbursti / average-sample.ino
Created March 25, 2021 22:23
Calc average value from given sample size w/ arduino-c
// immediate fan speed
int fanRpm = (60000000 / float(pulseIn(tachPin, LOW, 100000))) * 0.5;
// no average yet, use last fan reading
if (avgRpm == 0) {
avgRpm = fanRpm;
}
// check array vals for first -1
int emptyInd = -1;
@fgnass
fgnass / README.md
Created October 19, 2020 14:04
Next.js SSR + Capacitor

Goal

The goal is to package a server-side rendered Next.js app as SPA for capacitor.

Approach

Pages with dynamic routes/data use getServerSideProps(). For capacitor we need at least one page that can be rendered statically, preferably the index page.

When there are pages that use getServerSiedeProps() we can't use next export (it will fail with an error).

@atoponce
atoponce / gist:07d8d4c833873be2f68c34f9afc5a78a
Last active June 2, 2026 13:53 — forked from tqbf/gist:be58d2d39690c3b366ad
Cryptographic Best Practices

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@karpathy
karpathy / min-char-rnn.py
Last active September 17, 2026 12:55
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)