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
.DEFAULT_GOAL := help | |
# use '# >>> Build commands' to create section | |
# use '# target: target description' to create help for target | |
# example output from this file: | |
# $ make | |
# Usage: | |
# | |
# >>> Section 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 | |
""" | |
pysh | |
This script provides a command-line interface (CLI) for creating and running a | |
nix-shell environment with specified Python packages. It supports using different | |
Python versions and can optionally create a temporary virtual environment (venv) | |
to install packages. | |
Purpose: |
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 asyncio | |
import argparse | |
import random | |
from typing import Any | |
async def worker(name: str, queue: asyncio.Queue[str], stop_event: asyncio.Event): | |
while not stop_event.is_set() or not queue.empty(): | |
try: | |
# Try to get an item from the queue without indefinitely blocking | |
try: |
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 asyncio | |
import httpx | |
from typing import Callable, List, Any | |
from rich.console import Console | |
console = Console() | |
async def producer( |
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 | |
# NOTE: use newer & fixed version as package: https://pypi.org/project/mkchangelog/ | |
from __future__ import (absolute_import, division, print_function, | |
unicode_literals) | |
import argparse | |
import json | |
import logging | |
import os | |
import re |
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
Not a pretty sight | |
When the web dies screaming loud | |
The site is not found. | |
Morning and sorrow | |
404 not with us now | |
Lost to paradise. | |
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
#!/bin/bash | |
## ---------------------------------------------------------------------------------- ## | |
## Sets random image as wallpaper, trying remote url, local folder and fallback ## | |
## image. Then using executor like hyprpaper, feh, betterlockscreen or just prints ## | |
## found image to the output. ## | |
## ---------------------------------------------------------------------------------- ## | |
## https://gist.github.com/onjin/411d7f9c6ebcaf66aa75abe6941bea55 | |
## ---------------------------------------------------------------------------------- ## | |
## Example usage |
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
javascript: Promise.all([import('https://unpkg.com/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).then(async ([{ | |
default: Turndown | |
}, { | |
default: Readability | |
}]) => { | |
/* Optional vault name */ | |
const vault = ""; | |
/* Optional folder name such as "Clippings/" */ |
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 | |
""" | |
Example layout | |
2022/01/input_test.txt | |
2022/01/input_prod.txt | |
2022/01/code.py | |
Example code.py: | |
def phase_1(input: List[str]) -> Any: | |
# lines have '\n' at end |
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
RT = TypeVar('RT') # return type | |
def inject_user() -> Callable[[Callable[..., RT]], Callable[..., RT]]: | |
def decorator(func: Callable[..., RT]) -> Callable[..., RT]: | |
def wrapper(*args, **kwargs) -> RT: | |
# ... |
NewerOlder