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
""" | |
Example code to show a couple different ways to wait for futures to complete and still have the ability | |
to log/print something out periodically while waiting for the futures to complete. | |
(C) - MIT License - 2024 - Charles Machalow | |
""" | |
from concurrent.futures import ( | |
ThreadPoolExecutor, | |
as_completed, |
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
''' | |
Sample code to convert a module on import to snake_case from camelCase. | |
I wouldn't use this in production, but its kind of interesting to play with. | |
(C) 2023 - MIT License - Charles Machalow | |
''' | |
import inflection # pip install inflection | |
import inspect | |
import importlib | |
from typing import Any |
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
""" | |
A simple script to listen to a local weatherflow UDP broadcast and print out any received data. | |
(C) Charles Machalow via the MIT License (2023) .. See https://opensource.org/license/mit/ for details. | |
""" | |
import json | |
import logging | |
from pprint import pformat | |
from socket import AF_INET, IPPROTO_UDP, SOCK_DGRAM, socket | |
# pip install rich |
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
// ==UserScript== | |
// @name Google Messages Archiver | |
// @namespace Whatever | |
// @match https://messages.google.com/web/* | |
// @grant GM_log | |
// @author csm10495 | |
// @description Run doIt() in the console to archive all conversations after the most recent 5. | |
// @version 0.1.0 | |
// ==/UserScript== |
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
''' | |
Simple script to do a simple query against a cosmosdb in azure | |
Can use it to dump a db to json.. if ya need that for some reason. | |
MIT License - Charles Machalow | |
# pip install azure-cosmos | |
# pip install azure-identity | |
''' |
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
''' | |
Small script that tries to recursively find youtube video ids starting from given urls. | |
MIT License - Charles Machalow | |
''' | |
import time | |
import re | |
from datetime import timedelta, datetime | |
from typing import List, Set | |
from requests_html import HTMLSession | |
import requests |
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 base64 | |
import os | |
import subprocess | |
def run_command(cmd): | |
print (f">{cmd}") | |
ret_code = subprocess.call(cmd, shell=True) | |
print (f'>> Return Code: {ret_code}') | |
return ret_code |
This file has been truncated, but you can view the full file.
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
["00000000control", "0000FF", "0000THEFILM", "000155FF0C", "000webhost", "0013tardx", "004janine", "007chan", "007games", "007special", "007test007", "0080076503tm", "00Chanman00", "00E", "00FF00", "00FFFF", "00OA", "00Problems", "00d", "00easy", "00s", "00sKids", "00sMusic", "00sPorn", "00sRock", "00sScreamo", "00scartoons", "00sdesign", "00sonic", "00test00", "00th", "00weareready00", "00yearsago", "0121GFDO", "01884Fords", "01NebSucks", "01s", "01stworldproblems", "02Crew", "02keilj", "0311masterrace", "032c", "0333testtesttest", "03Esports", "03dfn3dndn9fno", "03s", "04manualg35coupes", "05sop14", "06prime", "06s", "06scape", "070Shake", "07Achievements", "07Clan", "07DeadManMode", "07F1D6B42A2BFEEBE910", "07Flipping", "07GWD", "07Guides", "07Helpers", "07Ironman", "07Memes", "07Merching", "07NARC", "07RSDevTracker", "07RSSuggestions", "07Scape", "07ScapeClues", "07Server", "07TRiBot", "07Warlocks", "07ada4381247db64", "07castlewars", "07craft", "07cw", "07deadman", "07exchange", "07garchomp", "07iron", " |
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
''' | |
Simple compression example | |
(C) - Charles Machalow - MIT License | |
Attempts to compress using a 'bit-compression' algorithm. Basically it goes | |
byte by byte trying to shrink each byte to the minimum number of bits needed to | |
represent each byte. If all 8 bits are needed, it will likely yield a larger than | |
original file. Often all 8 aren't needed if the file is something like ascii. | |
Some optimizations to speed that would likely speed this up greatly |
NewerOlder