Skip to content

Instantly share code, notes, and snippets.

View makesomelayouts's full-sized avatar
💨
Frontending & Neoviming

makesomelayouts

💨
Frontending & Neoviming
View GitHub Profile
adj = input("Adjective: ")
verb1 = input("Verb 1: ")
verb2 = input("Verb 2: ")
famous_person = input("Famous person: ")
madlib = f"Computer programming is so {adj}! It makes me so excited all the time because I love to {verb1}. Stay hidrated and {verb2} like you are {famous_person}!"
print(madlib)
@makesomelayouts
makesomelayouts / create_password.py
Created March 17, 2023 20:36
last print() is string of shuffle random ascii letters with digits in 12 length.
import secrets
import string
print(f'ascii_letters {string.ascii_letters}')
print(f'ascii_lowercase {string.ascii_lowercase}')
print(f'ascii_uppercase {string.ascii_uppercase}')
print(f'digits {string.digits}')
print(f'punctuation {string.punctuation}')
all_chars = string.ascii_letters + string.digits
from pytube import YouTube
if __name__ == '__main__':
links = [
# 'https://www.youtube.com/shorts/klmBTGQUkbM', 'https://www.youtube.com/watch?v=hS5CfP8n_js'
'https://www.youtube.com/watch?v=unUaqMJA9D0'
]
counter = 0
import requests
with open('proxies.txt') as f:
proxies = f.read().split('\n')
""" or!
proxies = f.readlines()
proxies = [proxy.strip() for proxy in proxies]
"""
working_proxies = []
import requests
from fake_useragent import UserAgent
response = requests.get('https://httpbin.org/get', headers={'user-agent': UserAgent().random})
print(response.status_code)
print(f'response.content={response.content}\n')
# Converting a list of strings to a list of integers
numbers = ['1', '2', '3', '4', '5']
result = list(map(int, numbers))
print(result) # [1, 2, 3, 4, 5]
# Multiplying each element of a list by 2
numbers = [1, 2, 3, 4, 5]
result = list(map(lambda x: x*2, numbers))
print(result) # [2, 4, 6, 8, 10]
import csv
import re
from collections import Counter
# for find ip's that DDoS server in local log.txt file
def reader(filename):
regexp = r'\d{1, 3}\.\d{1,3}\.d{1,3}' # \d = 0-9 ;; \d{1, 3} = 1-3
from difflib import SequenceMatcher
def Plagiarism_checker(f1, f2):
with open(f1, errors='ignore') as file1, open(f2, errors='ignore') as file2:
f1_data = file1.read()
f2_data = file2.read()
checking = SequenceMatcher(None, f1_data, f2_data).ratio()
print(f'These files are {checking * 100} % similar')
a, b = 1092, 1092; c = 1092
print(a is b is c) # True
a, b = 1092, 1092
c = 1092
print(a is b, a is c) # True, False
# but
a, b = 92, 92
@makesomelayouts
makesomelayouts / soup select vs soup find.txt
Created January 28, 2023 07:07
soup select vs soup find
soup = BeautifulSoup(src, 'lxml')
soup.select('.mzr-tc-group-table tr th')
# ==
soup.find(class_='mzr-tc-group-table').find('tr').find_all('th')