This file contains hidden or 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 python3 | |
# TODO overall completion % instead of single-countdown. | |
""" | |
Usage: | |
pomodoro [SESSIONS] [CYCLES] [WORK] [BREAK] [PAUSE] | |
pomodoro --total-cycles=TOTAL_CYCLES --sessions-of=CYCLES | |
Arguments: | |
SESSIONS Number of sessions (cycles then pause) [default: 9999] | |
CYCLES Number of cycles (work then break) per session: [default: 4] |
This file contains hidden or 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
@media (prefers-color-scheme: dark) { | |
:root { | |
--gray-10: #202224; | |
--gray-9: #3e4042; | |
--gray-8: #555759; | |
--gray-7: #6e7072; | |
--gray-6: #848688; | |
--gray-5: #aaacae; | |
--gray-4: #c6c8ca; | |
--gray-3: #dcdee0; |
This file contains hidden or 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
Artist | Title | |
---|---|---|
$stdout | Over Engineering | |
1f1n1ty, BilliumMoto | Stele, Prophecized | |
20syl | Inertia | |
20syl | Kodama | |
20syl, Oddisee | Ongoing Thing | |
20syl, Rita J | Voices | |
20syl | Swimming Stone | |
2smokeyy | Corn | |
2XM | Inperspect |
This file contains hidden or 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 enum import Enum | |
import re | |
import sys | |
from time import sleep | |
from rich import inspect, print, traceback | |
from bs4 import BeautifulSoup | |
from typing import Callable, NamedTuple, Optional | |
import requests | |
from urllib3.util.url import Url, parse_url, LocationParseError | |
from urllib.parse import urljoin |
This file contains hidden or 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
# Replace CHAN with desired 4chan.org/CHAN (eg 'c') and OUTFILE with a .html file to output the gallery to | |
# Be sure that you have defined a $BROWSER | |
curl https://a.4cdn.org/CHAN/catalog.json | jq "[.[].threads[] | {title: .sub?, post: (.last_replies[]? | { img: ((.tim? | tostring) + .ext?), comment: .com? })}]" | jq '[.[] | "<h2>\(.title)</h2><img src=https://i.4cdn.org/CHAN/\(.post.img) />"] | join("<hr>")' > OUTFILE && echo "<style>img{max-width:100vw}</style>" >> OUTFILE && $BROWSER OUTFILE |
This file contains hidden or 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 startproject --description "Start a project." | |
argparse --name="startproject" \ | |
'd/description=' \ | |
'h/help' \ | |
'p/path=' \ | |
'l/language=' \ | |
'o/owner=' \ | |
'k/kind=!startproject__validate_flag__kind' \ | |
'D/debug' \ | |
-- $argv |
This file contains hidden or 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 re | |
def to_unicode_superscript(n: int) -> str: | |
result = str() | |
for c in str(n): | |
result += { | |
"1": "¹", | |
"2": "²", | |
"3": "³", | |
"4": "⁴", |
This file contains hidden or 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
[tool.poetry] | |
name = "translator" | |
version = "0.1.0" | |
description = "" | |
authors = ["Ewen Le Bihan <[email protected]>"] | |
[tool.poetry.dependencies] | |
python = "^3.8" | |
beautifulsoup4 = "^4.9.3" |
This file contains hidden or 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 random | |
from rich import print | |
from rich.columns import Columns | |
from rich.console import Console | |
from rich.table import Table | |
from schoolsyst_api.database import COLLECTIONS | |
base59 = lambda len: "".join([random.choice(charset) for _ in range(len)]) |
This file contains hidden or 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
# Requires the following: (I'll try to make this less and less specific until it can become a real CLI) | |
# - toml ^0.10.1 | |
# - python-dotenv ^0.13.0 | |
# - pygithub ^1.51 | |
# - python ^3.6 | |
# - semantic-version ^2.8.5 (for the constants.py file) | |
# - a .env file with GITHUB_TOKEN, PYPI_USERNAME and PYPI_PASSWORD set | |
# (GITHUB_TOKEN is a Personal Access Token) | |
# - a {package name}/constants.py declaring a version with: | |
# from semantic_version import Version |