This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
consonants = ['q','w','r','t','y','p','s','d','f','g','h','j','k','l','z','x','c','v','b','n','m'] | |
vowels = ['a','e','i','o','u'] | |
app_is_running = True | |
def rand_in_list(List): | |
""" | |
Fetches a random element in a list. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import decimal as d | |
# In minecraft, often times you want to build totally symmetrical and nice looking pillars on your structure. | |
# This tells you how many blocks appart the pillars need to be for any given distance that you are doing the pillars along, | |
# in blocks. | |
gap_size = int(input("GapSize: ")) | |
for inner_gap_size in range(1,gap_size): | |
y = d.Decimal(gap_size - 1) / d.Decimal(inner_gap_size + 1) | |
if y % 1 == 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ast | |
import random | |
import string | |
Ascii = ['q','w','r','t','y','p','s','d','f','g','h','j','k','l','z','x','c','v','b','n','m','a','e','i','o','u'] | |
AppIsRunning = True | |
encodeSTR = """ | |
type ascii for standard english alphabet code, type a list \n | |
(separated by commas like this: a,b,c,d,e,f,g e.t.c.) for a key containing custom characters \n:""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
class OperatedList: | |
def __init__(self, *args: int): | |
self.list = list(args) | |
def __len__(self): | |
return len(self.list) | |
# Operation Functions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
# checks if a string contains another string | |
def ContainsString(str,checkfor): | |
for i in range(0,len(str)): | |
if (str[i:i+len(checkfor)] == checkfor): | |
return True | |
return False | |
# remove the directory if it contains a string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cmath | |
from PIL import Image | |
import yaml | |
#colors are expressed as (R,G,B) 0-255 | |
props = {} | |
with open('./props.yaml','rt') as f: | |
props = yaml.full_load(f.read()) | |
# view |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let id = "the id of the room to join here"; | |
let prefix = "@_Bot "; | |
let admin = [] | |
let superadmin = "the user in control of the admin commands" | |
require('dotenv').config(); | |
const { Client } = require('dogehouse.js'); | |
const app = new Client(); | |
app.connect(process.env.DOGEHOUSE_TOKEN, process.env.DOGEHOUSE_REFRESH_TOKEN).then(async () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shutil | |
to_clean = './compressed' | |
output = './full_cleaned' | |
if not os.path.exists(output): | |
os.makedirs(output) | |
def clean(dir:str): | |
children = [f'{dir}/{child}' for child in os.listdir(dir)] | |
files = [child for child in children if os.path.isfile(child)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pase poorly formatted school math assignment numbers here. | |
data = """32,33,21,51,44,25,35,82,55,47,52,38,39,43,48,51,53,37,40,15 | |
""" | |
# run the program, copy the output, paste to google sheets. much faster than retyping by hand. | |
import re | |
spl = re.split(pattern='[\n,]',string=data) | |
print('\n'.join(spl)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raw = '' | |
with open('raw.txt','rt') as f: | |
raw = f.read() | |
formatted = raw.split('\n') | |
import re | |
to_delete = [] | |
for index in (range(len(formatted))): |
OlderNewer