Skip to content

Instantly share code, notes, and snippets.

View tsengia's full-sized avatar
🐻

Tyler Sengia tsengia

🐻
View GitHub Profile
@tsengia
tsengia / setup-terminal.sh
Last active May 9, 2024 05:10
Temporarily configure a custom terminal prompt with specified host info and relative directory status.
#!/bin/bash
# NOTE: Tested on Kubuntu 24.04, using bash 5.2.21
host_info="${1}"
relative_dir="${2}"
if [ -z $relative_dir ]; then
relative_dir=$(dirname "${PWD}")
fi
@tsengia
tsengia / http-keepalive.py
Created March 14, 2020 18:50
Simple keep alive python3 script that makes a HTTP request every 2 minutes.
import time
import urllib.request
# Sleep for 2 minutes before sending the next keep alive
# This value is in seconds
DELAY = 120
# Url that we will be requesting.
URL = "https://example.com"
@tsengia
tsengia / traffic_lights.py
Created March 12, 2020 17:53
Cycles through traffic light LEDs until paused by a button.
from gpiozero import LED, Button
from time import sleep
from gpiozero import PushButton
red = LED(25)
yellow = LED(8)
green = LED(7)
button = Button(21)
@tsengia
tsengia / ExampleExtension.java
Created July 5, 2016 01:55
How to extend the LanguageManager class in a plugin
//This is skeleton/prototype code, just to explain how setting a custom LanguageManager would work
import net.glowstone.util.lang.LanguageManager;
class MyLanguage extends LanguageManager() {
/*
Methods and etc for the class, however you want it to work.
*/
}
/*
* Now to the plugin