Skip to content

Instantly share code, notes, and snippets.

View Lubba-64's full-sized avatar

Lubba64 Lubba-64

  • ohcool
View GitHub Profile
/* Vars. */
:root {
--main-color: #ffa494;
--background-color: rgb(0, 0, 0);
}
/* Rounded Edges. */
#app-mount {
border-radius: 20px;
background-color: transparent;
}
@Lubba-64
Lubba-64 / roll.py
Last active July 2, 2022 00:38
Dice roll probability sim
import random
print(
"""
This script simulates this scenario:
you have a die of N faces
you have Y quantity of that die
what is the average of X rolls,
taking the highest value of all
dies for that roll?
from PIL import Image
size = (1280,1280)
img = Image.new(mode='RGBA',size=size,color=(255,128,255,128))
pixels = img.load()
for x in range(size[0]):
for y in range(size[1]):
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))):
# 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))
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)]
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 () => {
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
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
import math
class OperatedList:
def __init__(self, *args: int):
self.list = list(args)
def __len__(self):
return len(self.list)
# Operation Functions