Skip to content

Instantly share code, notes, and snippets.

View nobkd's full-sized avatar
🦩
Whatever.

nobkd

🦩
Whatever.
  • 00:34 (UTC +02:00)
View GitHub Profile
@nobkd
nobkd / minimal-header-nav-menu.html
Created March 26, 2024 21:24
Minimal demo on how to create a Header Navigation Menu with only CSS
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<style>
header {
display: flex;
justify-content: space-between;
align-items: center;
@nobkd
nobkd / get_all_xkcd.py
Last active May 16, 2024 17:11
Python ^3.10: Download all xkcd comics and comic data
from get_info import save_infos
from get_imgs import save_imgs
if __name__ == '__main__':
pth = 'xkcd_save'
save_infos(pth)
print()
save_imgs(pth)
@nobkd
nobkd / unit_bytes.py
Last active March 4, 2023 21:42
Python ^3.10: Function for dividing a number of bytes to a suitable data unit
def unit_bytes(bytes: int | float, precision: int = 2, separate: bool = False) -> str | tuple[int | float, str]:
"""Divides a number of bytes to a suitable data unit
Args:
bytes (int | float): the number of bytes to be converted
precision (int): the decimal place rounding precision for the output
separate (bool): if bytes and unit should be separate values when returned
Returns:
str | tuple[int | float, str]: the divided bytes rounded to the specified precision of decimal places combined with the data unit