This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI and Documentation Deployment | |
on: | |
push: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
id-token: write | |
pages: write |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//compass | |
if (millis() - throttle > 500) { | |
throttle = millis(); | |
sensors_event_t event; | |
accel.getEvent(&event); | |
/* Display the results (acceleration is measured in m/s^2) */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File | |
import kotlin.math.abs | |
class AOC9 { | |
fun process() { | |
val input = File("/home/ben/aoc/input-9.txt") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
NewerOlder