git branch master
git checkout master
git branch -D main
git push origin master
git push origin :main
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
name | date | suffix_col | |
---|---|---|---|
test | 2014-12-31 | 1234 |
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 json | |
import logging | |
import psycopg2 | |
from lxml import html | |
from requests import session | |
DB_CONN = { | |
"host": "<your-db-host>", |
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
class MyDict(object): | |
def __init__(self, size=99999): | |
self.hash_list = [list() for _ in range(size)] | |
self.size = size | |
self.length = 0 | |
def __setitem__(self, key, value): | |
hashed_key = hash(key) % self.size | |
for item in self.hash_list[hashed_key]: | |
if item[0] == key: |
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
let rec is_odd_pos(num: int): bool = | |
if num = 0 then false | |
else is_even_pos(num - 1) | |
and is_even_pos(num: int): bool = | |
if num = 0 then true | |
else is_odd_pos(num - 1);; | |
let rec is_odd_neg(num: int): bool = | |
if num = 0 then false | |
else is_even_neg(num + 1) |
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
from PIL import Image, ImageDraw, ImageOps | |
corner_radius = 100 | |
def crop_to_circle(image_path, output_path, size): | |
original_image = Image.open(image_path) | |
square_image = ImageOps.fit(original_image, (1024, 1024), method=0, bleed=0.0, centering=(0.5, 0.5)) | |
rounded_image = Image.new("RGBA", square_image.size, (255, 255, 255, 0)) | |
draw = ImageDraw.Draw(rounded_image) |
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
certifi==2024.2.2 | |
charset-normalizer==3.3.2 | |
idna==3.6 | |
requests==2.31.0 | |
urllib3==2.2.1 |