Skip to content

Instantly share code, notes, and snippets.

View hamptonmoore's full-sized avatar
☄️
like a meteor I can feel my life crashing and burning

hammy hamptonmoore

☄️
like a meteor I can feel my life crashing and burning
View GitHub Profile
#pragma config(Sensor, in4, centerLineFollower, sensorLineFollower)
#pragma config(Sensor, dgtl1, rightEncoder, sensorQuadEncoder)
#pragma config(Sensor, dgtl3, leftEncoder, sensorQuadEncoder)
#pragma config(Sensor, in3, gyroSensor, sensorVirtualCompass)
#pragma config(Sensor, dgtl11, touchSensor, sensorTouch)
#pragma config(Sensor, dgtl8, sonarSensor, sensorSONAR_cm)
#pragma config(Motor, port2, rightMotor, tmotorServoContinuousRotation, openLoop, reversed)
#pragma config(Motor, port3, leftMotor, tmotorServoContinuousRotation, openLoop)
#!/bin/bash
METADATA=$(playerctl metadata --format "{{ title }} - {{ artist }}" 2>&1)
if [ "$METADATA" = "No player could handle this command" ]; then
echo ""
else # Can be configured to output differently when player is paused
polybar-msg -p "$(pgrep -f "polybar top")" hook spotify-play-pause 1 >/dev/null
echo "$METADATA"
fi
@hamptonmoore
hamptonmoore / grid.js
Created September 6, 2020 01:55
A very simple class for placing ascii art on a grid
class Grid {
constructor(width, height) {
this.width = width;
this.height = height;
this.map = [];
for (let y = 0; y < height; y++) {
this.map[y] = []; // set up inner array
const express = require("express");
const execSync = require("child_process").execSync;
const fs = require("fs");
const app = express();
const port = 6969;
function padIP(ip) {
let inflate = [];
ip.split(":").forEach((x) => (x != "" ? inflate.push("0".repeat(4 - x.length) + x) : inflate.push("")));
let zeroes = 0;
<body>
<header>
<h1>Hola Mundo!</h1>
</header>
<hr>
<main>
<p>
Welcome to my tiny spot on the internet. This is just a small little test site I threw together to show my friend Codepen.
</p>
from pybricks.pupdevices import Remote, Motor
from pybricks.parameters import Port, Button, Direction, Icon
from pybricks.robotics import DriveBase
from pybricks.hubs import PrimeHub
from pybricks.tools import wait
hub = PrimeHub()
# Connect to the remote.
my_remote = Remote(timeout=None)
let data = [{"Name": "John Doe", "Grade": 95 }, {"Name": "Mary Jane", "Grade": 98 }, {"Name": "Alice Templeton", "Grade": 90 }]
let sum = List/fold { cons: \x y -> x + y : Natural, nil: 0 }
let len = \d -> List/length d
let introduce = \person -> "Hello, "+person."Name" + " how are you doing, you got a "
let replicate
: forall (a : Type) . Natural -> a -> List a
= \n -> \x -> Natural/fold n (\xs -> [ x ] + xs) []
let replicate
: forall (a : Type) . Natural -> a -> List a
= \n -> \x -> Natural/fold n (\xs -> [ x ] + xs) []
let generate
: forall (a : Type) . Natural -> (Natural -> a) -> List a
= \n -> \f -> List/map (\x -> f x.index) (List/indexed (replicate n { }))
@hamptonmoore
hamptonmoore / index.html
Created September 26, 2022 04:40
UMass Amherst Cal Converter
<header>
<h1><img src="https://spire.umass.edu/heproda/images/wordmark.svg" style="height:0.8em"> Cal Converter - Fall 2022</h1>
</header>
<div>
<p>Please manually verify the output of this POS POC. It only works (probably, no promises) if you're currently on a device in the EDT (once we shift to EST it'll probably break) timezone. In addition it only works for the Fall 2022 session of classes at UMass Amherst. You can get your class calendar file at <a href="https://www.umass.edu/it/support/spire/download-your-class-and-final-exam-schedules#Download%20Your%20Class%20Schedule">https://www.umass.edu/it/support/spire/download-your-class-and-final-exam-schedules#Download%20Your%20Class%20Schedule</a>. The only issue is that one skips holidays and breaks, doesn't swap days with swapped classes, and ignores the last day of classes.</p>
<input type="file" onchange="readText(event)">
<p>Site made by <a href="https://hamptonmoore.com">Hampton Moore</a> | This site is not made, maintained, or approved of by

Hammy's Guide to Contributing with AVD

The information that follows represents knowledge that I wish I had when first contributing to the project. Keep in mind that this guide may not be applicable to your environment, and it should not be considered a comprehensive tutorial for the dev-env installation, nor a walkthrough. While many of these issues and fixes might seem obvious, when beginning contributions to a new project there is a lot of new information to absorb and systems to figure out, I figure the easier some steps are the better.

Installation: Navigating Python Package Management

If your Python environment resembles mine, it likely contains a myriad of randomly installed packages, with multiple Python versions and environments set up. In this context, I found pipenv to be the most straightforward tool. A simple pipenv install --python 3.11 command sets up the required Python environment in the AVD folder, followed by pipenv shell. After this, I configured VSCode to use the Python enviro