Skip to content

Instantly share code, notes, and snippets.

View prail's full-sized avatar
😎
bing chilling

Andrew Teesdale, Jr. prail

😎
bing chilling
View GitHub Profile
@prail
prail / changed.html
Last active August 4, 2024 03:33
Handbook Diffchecker
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
max-width: 800px;
margin: 0 auto;
}
@prail
prail / class_filter.awk
Created July 27, 2024 17:15
Eagles Nest Class Calendar Filter/Generator
# ICS file filter
BEGIN {
FS = ":"
buffer = ""
notevent = 0
}
($1~/^BEGIN/ && $2~/VEVENT/) {
keep = 1;
}
@prail
prail / banner_gen.py
Created April 9, 2023 22:19
Generates banner comments for CS227 programs
#!/usr/bin/python3
from sys import argv,exit
if len(argv) != 2: exit(1)
MAX_WIDTH = 72
print('/'+'*'*(MAX_WIDTH - 2)+'/\n/*{}*/'.format(argv[1].center(MAX_WIDTH-4))+'\n/'+'*'*(MAX_WIDTH - 2)+'/')
@prail
prail / center_banners.py
Last active April 9, 2023 22:17
Centers banner comments in CS227 programs
#!/usr/bin/python3
"""
This script finds all banner comments in a Howell (CS227) program and perfectly
centers them, so you won't get any points off on your programs for that.
Prints out the contents of the program just to be safe.
Andrew Teesdale, Jr. (f40c40.com)
"""
import sys
@prail
prail / pcc_stalker_dir.user.js
Created November 14, 2021 03:10
PCC Stalker Directory
// ==UserScript==
// @name Stalker Directory
// @version 1.0
// @description Adds images to the PCC student (stalker) directory.
// @author Andrew
// @match https://eaglesnest.pcci.edu/studentservices/studentdirectory/
// @icon https://www.google.com/s2/favicons?domain=pcci.edu
// @grant none
// ==/UserScript==
@prail
prail / SB.BNF
Last active March 11, 2018 02:58
BNF (sortof) grammar for SmileBASIC.
FULLEXPRESSION -> [ EXPRESSION ]
EXPRESSION -> "(" EXPRESSION ")" || VALUE [ OPERATOPERATOR EXPRESSION ] || UNARYOP SMALLEXPRESSION
SMALLEXPRESSION -> "(" EXPRESSION ")" || VALUE || UNARYOPERATOR [ SMALLEXPRESSION ]
CONSTANTEXPRESSION -> CONSTANT || "(" CONSTANTEXPRESSION ")" || CONSTANT [ CONSTANTOPERATOR CONSTANTEXPRESSION ] || CONSTANTUNARYOPERATOR SMALLCONSTANTEXPRESSION || STRING
SMALLCONSTANTEXPRESSION -> "(" CONSTANTEXPRESSION ")" || CONSTANT || CONSTANTUNARYOPERATOR [ SMALLCONSTANTEXPRESSION ]
CONSTANT -> NUMBER || "PI" "(" ")" || "#RED" etc.
UNARYOPERATOR -> "-" || "NOT" || "!"
OPERATOR -> "+" || "-" || etc.
@prail
prail / polyglot.bat
Created October 23, 2017 17:00
Bash and Batch polyglot. (Really nice for build scripts that need to support multiple platforms.)
echo off
echo ; set +v # > NUL
echo ; function GOTO { true; } # > NUL
GOTO WIN
# bash part, replace it to suit your needs
exit 0
:WIN
REM win part, replace it to suit your needs
@prail
prail / multiplayer.pseudocode
Created October 21, 2017 02:05
Just pseudocode for a simple multiplayer system.
if is host
while waiting for all clients.
send an accept packet to client.
send start packet to all clients.
while gameloop running
while not all data packets recieved
collect data packets from client.
send all packets to each client excluding sender.
update game state.
if is client
@prail
prail / README.md
Last active October 27, 2017 21:28
Gets a random picture from the nasa APOD.

APOD Desktop

To set this up you'll need to set your desktop background to slideshow mode. Create a directory in your pictures folder called APOD The script will put pictures in the directory. Set up a windows service to run the script once a day. profit! The script also creates a file on your desktop named description.txt it contains the pictures descript in a nice readable format if you're curious. Be careful when changing the APOD_DIRECTORY! This directory is removed and recreated very often so don't set it to something important like your Pictures directory.

@prail
prail / list.c
Created October 16, 2017 21:16
Just a linked list program I made for future reference.
#include <stdio.h>
#include <stdlib.h>
typedef struct node_t{
int x;
struct node_t *next;
} node_t;
node_t *list_create(int x,node_t *next) {
node_t *new_node = (node_t *)malloc(sizeof(node_t));