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
  • 07:23 (UTC)
View GitHub Profile
import random
import timeit
from datetime import datetime
from datetime import timedelta
from pytz import timezone
"""
pip install pytz
"""
@CheeseCake87
CheeseCake87 / postgres-cheatsheet.md
Created March 19, 2023 19:34 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@CheeseCake87
CheeseCake87 / animals.py
Created September 7, 2022 22:24
Big list of animals in a python list
animals = ['Canidae', 'Felidae', 'Cat', 'Cattle', 'Dog', 'Donkey', 'Goat', 'Horse', 'Pig', 'Rabbit',
'Aardvark', 'Aardwolf', 'Albatross', 'Alligator', 'Alpaca', 'Amphibian', 'Anaconda',
'Angelfish', 'Anglerfish', 'Ant', 'Anteater', 'Antelope', 'Antlion', 'Ape', 'Aphid',
'Armadillo', 'Asp', 'Baboon', 'Badger', 'Bandicoot', 'Barnacle', 'Barracuda', 'Basilisk',
'Bass', 'Bat', 'Bear', 'Beaver', 'Bedbug', 'Bee', 'Beetle', 'Bird', 'Bison', 'Blackbird',
'Boa', 'Boar', 'Bobcat', 'Bobolink', 'Bonobo', 'Bovid', 'Bug', 'Butterfly', 'Buzzard',
'Camel', 'Canid', 'Capybara', 'Cardinal', 'Caribou', 'Carp', 'Cat', 'Catshark',
'Caterpillar', 'Catfish', 'Cattle', 'Centipede', 'Cephalopod', 'Chameleon', 'Cheetah',
'Chickadee', 'Chicken', 'Chimpanzee', 'Chinchilla', 'Chipmunk', 'Clam', 'Clownfish',
'Cobra', 'Cockroach', 'Cod', 'Condor', 'Constrictor', 'Coral', 'Cougar', 'Cow', 'Coyote',
@CheeseCake87
CheeseCake87 / hex_web_colors.py
Created September 7, 2022 22:19
A big list of HTML colors with their hex values
html_hex_colors = {'Black': '#000000', 'Night': '#0C090A', 'Charcoal': '#34282C', 'Oil': '#3B3131', 'Dark Gray': '#3A3B3C', 'Light Black': '#454545',
'Black Cat': '#413839', 'Iridium': '#3D3C3A', 'Black Eel': '#463E3F', 'Black Cow': '#4C4646', 'Gray Wolf': '#504A4B', 'Vampire Gray': '#565051',
'Iron Gray': '#52595D', 'Gray Dolphin': '#5C5858', 'Carbon Gray': '#625D5D', 'Ash Gray': '#666362', 'DimGray DimGrey': '#696969',
'Nardo Gray': '#686A6C', 'Cloudy Gray': '#6D6968', 'Smokey Gray': '#726E6D', 'Alien Gray': '#736F6E', 'Sonic Silver': '#757575',
'Platinum Gray': '#797979', 'Granite': '#837E7C', 'Gray Grey': '#808080', 'Battleship Gray': '#848482', 'Gunmetal Gray': '#8D918D',
'DarkGray DarkGrey': '#A9A9A9', 'Gray Cloud': '#B6B6B4', 'Silver': '#C0C0C0', 'Pale Silver': '#C9C0BB', 'Gray Goose': '#D1D0CE',
'Platinum Silver': '#CECECE', 'LightGray LightGrey': '#D3D3D3', 'Gainsboro': '#DCDCDC', 'Platinum': '#E5E4E2', 'Metallic Silver': '#BCC6CC',
@CheeseCake87
CheeseCake87 / auth.py
Last active September 22, 2023 13:12
import re
import itertools
from dataclasses import dataclass
from datetime import datetime
from hashlib import sha1, sha256, sha512
from random import choice
from random import randrange
from string import punctuation, ascii_letters