Skip to content

Instantly share code, notes, and snippets.

@palashmon
palashmon / Readme.md
Last active March 16, 2025 18:51
Creating JSDoc `@types` for Different Data Types in JavaScript
@csm10495
csm10495 / locked_cookie_test.py
Last active April 5, 2025 19:59
POC that fetches cookies from a locked cookies file on Windows with Chromium based browsers
@twolfson
twolfson / README.rst
Last active April 25, 2025 09:09
Evaluation and comparison of various Python templating libraries

gist-python-templating-evaluation

@whoisjeeva
whoisjeeva / socks5.py
Created January 15, 2021 11:47
Socks5 proxy server in Python
import socket
import threading
import select
SOCKS_VERSION = 5
class Proxy:
@hosackm
hosackm / colorlog.py
Created July 28, 2020 01:39
Colored logger module using Colorama
import logging
from colorama import init, Fore, Back
init(autoreset=True)
class ColorFormatter(logging.Formatter):
# Change this dictionary to suit your coloring needs!
COLORS = {
"WARNING": Fore.RED,
## Link to excel export of market watch
http://members.tsetmc.com/tsev2/excel/MarketWatchPlus.aspx?d=0&format=0
## Variables list
inscode: "15521712617204216"
iid: "IRO1SFKZ0001"
l18: "سفارس"
l30: "سيمان فارس و خوزستان"
py: "8557"
bvol: "5131363"
@abdalmoez
abdalmoez / python-udp-send-packet.py
Last active February 19, 2025 09:50
Send udp packet using python
import socket
UDP_IP = "127.0.0.1"
UDP_PORT = 1234
MESSAGE = "Hello, World!"
print ("UDP target IP:", UDP_IP)
print ("UDP target port:", UDP_PORT)
print ("message:", MESSAGE)
@Paikan
Paikan / reproduction.py
Created November 7, 2019 14:05
Bug in wikitextparser with tables
import json
import wikitextparser
with open("table1.json") as f: # or table2.json
data = json.load(f)
source = data["source_text"]
parsed = wikitextparser.parse(source)
print("Processing tables")
# This one will hang
@dabeaz
dabeaz / aproducer.py
Created October 17, 2019 17:46
"Build Your Own Async" Workshop - PyCon India - October 14, 2019 - https://www.youtube.com/watch?v=Y4Gt3Xjd7G8
# aproducer.py
#
# Async Producer-consumer problem.
# Challenge: How to implement the same functionality, but no threads.
import time
from collections import deque
import heapq
class Scheduler:
@cb109
cb109 / vscode_python_sort_imports_isort_on_save.md
Last active April 29, 2025 08:19
VSCode: Python Sort Imports on File Save (isort)

VSCode: Python Sort Imports on File Save (isort)

  • Make sure the isort extension is installed in VSCode

Update April 2025

The latest VSCode update brought the requirement to use a python environment 3.8+ for isort:

2025-04-24 13:28:29.888 [info] No interpreter found from setting isort.interpreter