Skip to content

Instantly share code, notes, and snippets.

View chand1012's full-sized avatar

Chandler chand1012

View GitHub Profile
@chand1012
chand1012 / rand_err.py
Created January 13, 2021 15:43
Random error generator designed to make really confusing random errors.
# From my friend Alex
import math, random
Errors = [
"Error",
"Log",
"File",
"Creation",
"Pressure",
@chand1012
chand1012 / twitch_chat_json.py
Last active September 6, 2021 04:38
Get all of the twitch chat from a twitch VOD. See license here: https://chand1012.mit-license.org/
import os
import json
from twitch import Helix
from twitch.v5.models.comment import Comment
def comment_to_dict(comment: Comment):
return {
'id': comment.id,
'created_at': comment.created_at,
import os
from tqdm import tqdm
import requests
from bs4 import BeautifulSoup
base_url = "http://www.textfiles.com/etext/"
endings = ['MODERN', 'FICTION', 'NON-FICTION', 'REFERENCE']
if not os.path.exists('files'):
@chand1012
chand1012 / linting.yml
Created December 4, 2020 06:21
GitHub Actions Linting Script. Could also be configured to create a PR if needed.
name: Python Linting
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
@chand1012
chand1012 / home_dir_example
Created August 10, 2020 19:52
Example of listing your home directory
Desktop
Documents
Downloads
Music
Pictures
Public
Templates
Videos
@chand1012
chand1012 / lackExtender.scad
Created July 20, 2020 01:23
This is my lack table extender.
// in mm
height = 180;
leg_width = 55.88;// this is the length of width of the table leg
union() {
translate([0, 0, height*0.6]) {
difference() {
cube([leg_width, leg_width, 38.1], center=true);
cube([leg_width-6.35, leg_width-6.35, 38.25], center=true);
@chand1012
chand1012 / blinds.py
Created July 11, 2020 20:11
Scheduling System from Ian's Blinds project.
from json import loads
from datetime import datetime
from time import sleep
def operate_blinds(opened=False):
# operate the blinds
# write your blind operation code here
print(f"Blinds state: {opened}")
if __name__=="__main__":
@chand1012
chand1012 / weather.py
Last active July 2, 2020 15:15
US government weather api response time test
import requests
class USGovWeatherSearch():
def __init__(self):
self.lat = 41.08
self.lng = -81.51
self.gridx = 0
self.gridy = 0
self.base_url = "https://api.weather.gov/"
self.json = None
@chand1012
chand1012 / equal.cpp
Created April 22, 2020 16:07
Random recursive equal function
bool equal(int x, int y)
{
if (x == 0 && y == 0)
{
return true;
}
x--;
y--;
if (x<0 || y<0)
{
@chand1012
chand1012 / MyPrusaSlicerSettings.ini
Created January 30, 2020 20:16
My settings for my Ender 3 on PrusaSlicer
# generated by PrusaSlicer 2.1.1+win64 on 2020-01-30 at 20:15:18 UTC
[print:0.2 mm]
avoid_crossing_perimeters = 0
bottom_fill_pattern = rectilinear
bottom_solid_layers = 3
bridge_acceleration = 0
bridge_angle = 0
bridge_flow_ratio = 1
bridge_speed = 60