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 __future__ import annotations | |
import os | |
from prompt_toolkit.formatted_text import FormattedText, StyleAndTextTuples | |
class TokenizedFormattedText(FormattedText): | |
__slots__ = ("parent_token_class",) | |
def __init__(self, tokens_list: StyleAndTextTuples, parent_token_class: str) -> None: | |
is_not_formatted_text = not isinstance( | |
tokens_list, (TokenizedFormattedText, FormattedText) |
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
using namespace System.Management.Automation | |
using namespace System.Management.Automation.Language | |
using namespace Microsoft.PowerShell.PSConsoleReadLine | |
if ($host.Name -eq 'ConsoleHost') { | |
Import-Module PSReadLine | |
} | |
Import-Module -Name Terminal-Icons |
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
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"version": 2, | |
"final_space": true, | |
"var": { | |
"shell_icons": { | |
"pwsh": "", | |
"cmd": "", | |
"bash": "", | |
"zsh": "%_", |
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
# This Python code can get you the channel ID of anybody's YT channel | |
# Just either from the url from one of their videos, their channel, playlists, etc. | |
# Requires aiohttp (for asychronous requests) | |
from aiohttp import ClientSession | |
import asyncio | |
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
#!/usr/bin/env bash | |
# Download a podcast episode from anchor.fm | |
# | |
# Usage: | |
# grab-anchor-episode "https://anchor.fm/emerge/episodes/Robert-MacNaughton---Learnings-from-the-Life-and-Death-of-the-Integral-Center-e31val" # (m4a example) | |
# grab-anchor-episode "https://anchor.fm/free-chapel/episodes/Are-You-Still-In-Love-With-Praise--Pastor-Jentezen-Franklin-e19u4i8" # (mp3 example) | |
# | |
# anchor.fm serves a list of m4a or mp3 files that need to be concatenated with ffmpeg. | |
# |
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
def int_to_roman_num(number:int) -> str: | |
num, string, lst = str(number)[::-1], 'IVXLCDM', [] | |
for index, val in enumerate(map(int, num)): | |
if val == 0: continue | |
(q, r), index2 = divmod(val, 5), index*2 | |
if val in (4, 9): | |
temp = f'{string[index2]}{string[index2+q+1]}' | |
else: | |
temp = f'{string[index2+q]*q}{string[index2]*r}' |