Skip to content

Instantly share code, notes, and snippets.

View GhostOps77's full-sized avatar
Not Available

Ghost Ops GhostOps77

Not Available
  • Somewhere in a Dark place
View GitHub Profile
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)
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
GhostOps77 / oh-my-posh-config.json
Last active January 28, 2024 15:19
My oh-my-posh config
"$schema": "",
"version": 2,
"final_space": true,
"var": {
"shell_icons": {
"pwsh": "",
"cmd": "",
"bash": "",
"zsh": "%_",
GhostOps77 /
Last active December 31, 2022 13:59
This Python code can get you the channel ID of someone's channel just from the url of their channel, or one of their videos
# 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
GhostOps77 /
Created November 16, 2022 14:06 — forked from ivan/
Download a podcast episode from
#!/usr/bin/env bash
# Download a podcast episode from
# Usage:
# grab-anchor-episode "" # (m4a example)
# grab-anchor-episode "" # (mp3 example)
# serves a list of m4a or mp3 files that need to be concatenated with ffmpeg.
GhostOps77 /
Last active March 19, 2022 13:49
A sample code that can convert Integer to Roman numeral in Python (not the fastest, but still it works; kind of)
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]}'
temp = f'{string[index2+q]*q}{string[index2]*r}'