Skip to content

Instantly share code, notes, and snippets.

View mralext20's full-sized avatar

Alexander Terry mralext20

  • Alaska
  • 00:45 (UTC -09:00)
View GitHub Profile
@mralext20
mralext20 / gen_qr_codes.py
Last active June 23, 2024 00:15
generates QR codes with letter and number pairs, saves to a PDF
import os
from PIL import Image
from PIL import ImageDraw
from qrcode.main import QRCode
from qrcode.constants import ERROR_CORRECT_L
from PIL import ImageFont
from typing import List, Sequence, Generator, Tuple, TypeVar, Union
import math
import shutil
import time
@mralext20
mralext20 / schoolCafe.py
Created March 5, 2021 19:02
School cafe discord poster
from datetime import date as Date
import requests as req
import json
from tokens import discord_alex # a discord token
from tokens import post_discord # a method to post to a discord channel a string
def get_items(menu, category):
ret_list = []
for i in menu[category]:
@mralext20
mralext20 / main.py
Last active February 12, 2021 05:59
neosTZ
import json
import pytz
import csv
import requests
from datetime import datetime
from time import sleep
from requests.models import HTTPError
JSON_FILE = "members.json"
import json
import sqlite3
file = "data.db"
table = "booths"
rows = ["title", "description", "video", "school"]
columnForFileName = 'title'
targetDir = "export"
conn = sqlite3.connect(file)
image=in.png
convert ${image} -resize "32x32!" -modulate 100,300,100 "single.png"
for ((z=2; z<= 8; z+=1))
do
height=$((z * 32))
convert ${image} -resize "${height}x${height}!" -modulate 100,300,100 "temp${z}.png"
if [ -d "${z}" ]
then
rm -dr $z
~/source/lovr/build   master  emmake make -j8
make: ['make', '-j8']
make[1]: Entering directory '/home/alexander/source/lovr/build'
make[2]: Entering directory '/home/alexander/source/lovr/build'
make[2]: Entering directory '/home/alexander/source/lovr/build'
make[2]: Entering directory '/home/alexander/source/lovr/build'
make[2]: Entering directory '/home/alexander/source/lovr/build'
make[2]: Entering directory '/home/alexander/source/lovr/build'
make[2]: Entering directory '/home/alexander/source/lovr/build'
make[2]: Entering directory '/home/alexander/source/lovr/build'
function facing(target)
write('inspecting for ')
print(target)
f,v = turtle.inspect()
if f then
if v.name==target then
return true
else
return false
end
/*
* turn(625) gives you a turn to the leftby 90 degrees.
* this method can be given negative numbers in order to turn right.
*
* drive()
*
*
*/
package org.firstinspires.ftc.teamcode;
#/bin/sh
text=${1,,} #lowercase the string
for i in $(seq 1 ${#1}) #first loop, prints the regional indicators
do
if [ "${text:i-1:1}" = " " ]
then
echo -n " "
else if [ "${text:i-1:1}" = "-" ]
#!/usr/bin/env python3
import requests, json, calendar, datetime
prejson = requests.get('http://schedule-server.riffle.tv/schedule/peekingboo')
data = json.loads(prejson.text)
#create empty list containing None, will be popped latter.