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
CREATE TABLE public.vouchers ( | |
id serial PRIMARY KEY, | |
name text NOT NULL | |
); | |
INSERT INTO vouchers | |
(name) | |
VALUES | |
('Sales'), | |
('Purchase'), |
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
CREATE TABLE account_groups | |
( | |
id bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1 ), | |
name text COLLATE pg_catalog."default" NOT NULL, | |
account_group_id bigint, | |
CONSTRAINT account_types_pkey PRIMARY KEY (id), | |
CONSTRAINT account_groups_account_group_id_fkey FOREIGN KEY (account_group_id) | |
REFERENCES public.account_groups (id) MATCH SIMPLE | |
ON UPDATE NO ACTION | |
ON DELETE NO ACTION, |
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
def build_keyboard(buttons, n_cols=2, resize=True, auto_cols=False, auto_arrange=False, header_buttons=None, footer_buttons=None): | |
text_cols = {1: 8, 2: 7, 3: 6, 4: 5} # dict text size as key and possible columns as value | |
longest_text, longest_button = 1, buttons[0] | |
lengths_list = [] # to find second largest text | |
for button in buttons: | |
length = len(button.text if isinstance(button, InlineKeyboardButton) else button) | |
lengths_list.append(length) | |
longest_button = button if length >= longest_text else longest_button | |
longest_text = length if length >= longest_text else longest_text |
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 turtle | |
turtle.hideturtle() | |
data = {"P": 'red', "y": 'dark blue', "t": 'green', "h": 'purple', "o": 'orange', "n": 'purple'} | |
for key in data: | |
turtle.color(data.get(key)) | |
turtle.write( key, move= False, align="center", font=("comic sans", 22, "bold") ) | |
turtle.penup() | |
turtle.forward(22) | |
turtle.pendown() |
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 turtle | |
turtle.hideturtle() | |
turtle.color('yellow') | |
turtle.begin_fill() | |
turtle.width(5) | |
turtle.penup() | |
turtle.goto(0,0) | |
turtle.pendown() | |
turtle.forward(150) | |
turtle.left(90) |
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 time | |
import random | |
room = ('rooster', 'hen') #must be tuple | |
effort = random.randint(5,10) | |
egg = 0 | |
for times in range(effort): | |
egg += round((len(room[0]) / len(room[1])) + (len(room[1]) / len(room[0]))) | |
time.sleep(2) #don't worry time is not too less, there's a reason rooster is called cock | |
#change time as per your rooster | |
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 requests | |
from bs4 import BeautifulSoup | |
import re | |
import clipboard | |
clipboard = clipboard.get() | |
if 'http' not in clipboard: | |
url = input('Enter the URL: ') #Enter the url address of website you want to generate payload template for | |
else: | |
url = (re.search('(http\S+)', clipboard)).group(1) |