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
#!/usr/bin/env python | |
# MIT License | |
# Copyright (c) 2022-present, Manuel Solorzano | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
function custom_prompt { | |
# https://tldp.org/HOWTO/Bash-Prompt-HOWTO/bash-prompt-escape-sequences.html | |
# \e == \033 | |
# Select Graphic Rendition parameters | |
# 30–37 selected the foreground color | |
# 40–47 selected the background color | |
# prompt | |
FMT_RESET="\[\e[0m\]" |
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 functools | |
def decorator(func_to_decorate): | |
@functools.wraps(func_to_decorate) | |
def wrapper(*args, **kwargs): | |
# 👉 BEFORE 👈 invocation | |
result = func_to_decorate(*args, **kwargs) | |
# 👉 AFTER 👈 invocation | |
return result | |
return wrapper |
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 | |
# r = requests.get("coderbyte.com/api/challenges/json/age-counting") | |
# d = r.json() | |
d = { | |
"data": "key=IAfpK, age=58, key=WNVdi, age=64, key=jp9zt, age=47, key=0Sr4C, age=68, key=CGEqo, age=76, ... key=cFCfU, age=5, key=J8an1, age=48, key=dkSlj, age=5" | |
} | |
l = d['data'].split(", ") |
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
# https://stackoverflow.com/q/41275345/ | |
def dist(s1, s2): | |
cur = list(range(len(s2) + 1)) | |
prev = [0] * (len(s2) + 1) | |
print(f"{cur=}") | |
print(f"{prev=}") | |
input() | |
for i in range(len(s1)): | |
cur, prev = prev, cur | |
cur[0] = i + 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
#!/usr/bin/env python | |
import sys | |
import datetime | |
import argparse | |
import urllib.request | |
parser = argparse.ArgumentParser() | |
parser.add_argument('yt_video_url', type=str) | |
args = parser.parse_args() |
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
#!/usr/bin/env python | |
import sys | |
import time | |
import json | |
import argparse | |
import locale | |
import datetime | |
import urllib.request |
-
Insert USB
-
Unmount it
# Check where is mounted
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 15,7G 0 disk