Skip to content

Instantly share code, notes, and snippets.

View CheeseCake87's full-sized avatar
๐Ÿ
Oh look, a bee.

David CheeseCake87

๐Ÿ
Oh look, a bee.
  • Scotland
  • 22:12 (UTC)
View GitHub Profile
@CheeseCake87
CheeseCake87 / cf_domain_reg_prices_2025_7_4.json
Created July 4, 2025 21:57
Cloudflare domain registration prices - 4th July 2025
{
".ac": {
"price": 4500,
"renewal": 4500
},
".academy": {
"price": 3318,
"renewal": 3318
},
".accountant": {
@CheeseCake87
CheeseCake87 / 30_days_of_routes.py
Last active May 3, 2025 12:52
30 days of routes hit
status_200 = [
{'count': 2542, 'route': '/'},
{'count': 455, 'route': '/robots.txt'}
]
status_404 = [
{'count': 74, 'route': '/favicon.ico'},
{'count': 33, 'route': '/xmlrpc.php'},
{'count': 30, 'route': '/cms/wp-includes/wlwmanifest.xml'},
{'count': 30, 'route': '/site/wp-includes/wlwmanifest.xml'},
import random
OFFICIAL_LOCAL_MNEMONICS_LOOKUP = {
"A": "anglia",
"B": "birmingham",
"C": "cymru",
"D": "deeside",
"E": "essex",
"F": "forest_and_fens",
@CheeseCake87
CheeseCake87 / beautifulsoup4_selenium.py
Last active February 13, 2025 12:18
Beautifulsoup4 + Selenium Example
"""
Setup:
python3 -m venv .venv
source .venv/bin/activate
Requirements:
pip install beautifulsoup4 selenium
"""
requirements:
pip install pytz
pip install python-dotenv
pip install requests
- create .env file with the following -
DVLA_VES_API_KEY=""
@CheeseCake87
CheeseCake87 / delete_from_rustdesk.py
Last active November 26, 2024 18:54
Example of some code that is able to delete devices from RustDesk
"""
requirements:
python-dotenv
requests
"""
import os
from json import JSONDecodeError
import typing as t
def is_truly(value: t.Optional[t.Union[str, bool, int]]) -> bool:
if isinstance(value, int):
return True if value > 0 else False
if isinstance(value, bool):
return value
def camel_case_to_snake_case(value: str) -> str:
"""
Switches name of the class CamelCase to snake_case
"""
special_characters = [
" ",
"-",
"(",
")",
".",
class Colors:
@classmethod
def color_names(cls):
return cls.colors.keys()
@classmethod
def color_values(cls):
return cls.colors.values()
import re
from typing import Literal, Optional, List
def clean_string(
string: str,
remove_these: Optional[
List[Literal["new_line", "tab", "dead_space"]]
] = None
) -> str: