Skip to content

Instantly share code, notes, and snippets.

View dcnetw0rk's full-sized avatar
💀
Hacker for Hire

dcnetw0rk dcnetw0rk

💀
Hacker for Hire
  • Los Angeles, CA
View GitHub Profile
@dcnetw0rk
dcnetw0rk / FastTelethon.py
Created February 19, 2023 00:19 — forked from painor/FastTelethon.py
This will increase the download/upload speed when using telethon
# copied from https://github.com/tulir/mautrix-telegram/blob/master/mautrix_telegram/util/parallel_file_transfer.py
# Copyright (C) 2021 Tulir Asokan
import asyncio
import hashlib
import inspect
import logging
import math
import os
from collections import defaultdict
from typing import Optional, List, AsyncGenerator, Union, Awaitable, DefaultDict, Tuple, BinaryIO
@dcnetw0rk
dcnetw0rk / convert_hex_xterm.py
Created March 4, 2023 03:03 — forked from chrisdiana/convert_hex_xterm.py
Convert hex color code to closest xterm-256 value
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_code
@dcnetw0rk
dcnetw0rk / colortrans.py
Created November 11, 2023 18:45 — forked from MicahElliott/colortrans.py
Convert values between RGB hex codes and xterm-256 color codes.
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_code