Skip to content

Instantly share code, notes, and snippets.

View kirillzhosul's full-sized avatar
💭
I may be slow to respond.

Kirill Zhosul kirillzhosul

💭
I may be slow to respond.
View GitHub Profile
@kirillzhosul
kirillzhosul / imports.py
Created May 12, 2024 21:35
Get (detect) imports from raw python source
import ast
exprs = [
"""
import flask
import django
a = 'hello world!'
b = __import__
b("io")
@kirillzhosul
kirillzhosul / nginx.conf
Last active April 22, 2022 17:54
NGINX Proxy config
# Keep as-is.
events {
worker_connections 1024;
}
http {
# Keep as-is.
include mime.types;
default_type application/octet-stream;
sendfile on;
@kirillzhosul
kirillzhosul / json2html.py
Last active April 22, 2022 17:54
JSON to HTML python script.
from typing import Dict, List, Optional, Union
class HTMLTag:
def __init__(self, name: str, data: Union[List["HTMLTag"], any], params: Optional[Dict] = None):
self.name = name
self.data = data
self.params = params
def __str_params(self):