Skip to content

Instantly share code, notes, and snippets.

View bsautner's full-sized avatar
🎯
Focusing

Benjamin Sautner bsautner

🎯
Focusing
  • Philadelphia, PA
View GitHub Profile
@bsautner
bsautner / gist:6a34af233d2f073d67e10c24cc98e963
Created February 10, 2025 22:27
Github Action for deploying writeside docs with kodda html
name: CI and Documentation Deployment
on:
push:
branches: [ "main" ]
permissions:
contents: read
id-token: write
pages: write
@bsautner
bsautner / prep.sh
Created January 30, 2025 16:49
preparing ubuntu to build nvidia
dpkg --add-architecture i386
apt update && sudo apt upgrade -y
uname -r
ls /usr/src/linux-headers-$(uname -r)
apt install --reinstall build-essential dkms linux-headers-$(uname -r) wget -y
sudo bash -c "echo 'blacklist nouveau' > /etc/modprobe.d/blacklist-nouveau.conf"
sudo bash -c "echo 'options nouveau modeset=0' >> /etc/modprobe.d/blacklist-nouveau.conf"
sudo update-initramfs -u
@bsautner
bsautner / fat.gradle
Created April 24, 2023 12:38
fat jar
val kotlinVersion = "1.8"
val serializationVersion = "1.4.0"
val ktorVersion = "2.1.1"
val logbackVersion = "1.4.1"
val kotlinWrappersVersion = "1.0.0-pre.386"
val kmongoVersion = "4.7.1"
plugins {
kotlin("multiplatform") version "1.7.20-Beta"
application
@bsautner
bsautner / bot.py
Created April 11, 2023 15:08
python to make a bot run around
import time
import math as m
import socket
import RPi.GPIO as GPIO
# import RPi.GPIO
pin_motor_1_a = 21 # GPOIO38
pin_motor_1_b = 20 # GPIO40
//compass
if (millis() - throttle > 500) {
throttle = millis();
sensors_event_t event;
accel.getEvent(&event);
/* Display the results (acceleration is measured in m/s^2) */
@bsautner
bsautner / AOC11.kt
Created December 11, 2022 18:54
AOC11.kt
import java.io.File
import java.math.BigDecimal
class AOC11 {
private val rounds = 20
private val monkeys = mutableListOf<Monkey>()
private val monkeys2 = mutableListOf<Monkey2>()
fun process() {
@bsautner
bsautner / AOC9.kt
Last active December 9, 2022 18:53
import java.io.File
import kotlin.math.abs
class AOC9 {
fun process() {
val input = File("/home/ben/aoc/input-9.txt")
@bsautner
bsautner / AOC8.kt
Last active December 8, 2022 19:56
import java.io.File
class AOC8 {
var maxScore = 0
fun process() {
val input = File("/home/ben/aoc/input-8.txt")
val sample = input.useLines { it.toList() }
@bsautner
bsautner / AOC7.kt
Last active December 7, 2022 19:58
import java.io.File
class AOC7 {
private val input = File("/home/ben/aoc/input-7.txt")
private val list = mutableListOf<String>()
private var PWD = Node("root", null) //Present Working Directory
var spaceNeeded = 0L
@bsautner
bsautner / AOC6.kt
Last active December 6, 2022 14:12
fun main(args: Array<String>) {
val input = File("/home/ben/aoc/input-6.txt").readText()
getFirstMarker(input, 4)
getFirstMarker(input, 14)
}
fun getFirstMarker(data: String, window : Int) {
for (i in 0..data.length) {
if (i + window <= data.length) {