Skip to content

Instantly share code, notes, and snippets.

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

Sylvain Marié smarie

💭
I may be slow to respond.
View GitHub Profile
@sstevan
sstevan / socksimap.py
Last active May 8, 2024 14:05
Python (v2 - v3) - IMAP through SOCKS proxy using PySocks module
import ssl
from socks import create_connection
from socks import PROXY_TYPE_SOCKS4
from socks import PROXY_TYPE_SOCKS5
from socks import PROXY_TYPE_HTTP
from imaplib import IMAP4
from imaplib import IMAP4_PORT
from imaplib import IMAP4_SSL_PORT
@pylover
pylover / inspections.txt
Last active April 22, 2024 07:47 — forked from ar45/inspections.txt
PyCharm inspections
# Extracted using: $ unzip -p lib/pycharm.jar com/jetbrains/python/PyBundle.properties | grep -B1 INSP.NAME | grep '^#' | sed 's|Inspection||g' | sed -e 's|#\s\{,1\}|# noinspection |'
# noinspection PyPep8
# noinspection PyPep8Naming
# noinspection PyTypeChecker
# noinspection PyAbstractClass
# noinspection PyArgumentEqualDefault
# noinspection PyArgumentList
# noinspection PyAssignmentToLoopOrWithParameter
# noinspection PyAttributeOutsideInit
@jvrplmlmn
jvrplmlmn / tree.py
Last active February 24, 2020 12:45
Python implementation of tree command
# -*- coding: utf-8 -*-
from os import walk, sep
from os.path import basename, isdir
from sys import argv
def tree(startpath, print_files=False):
for root, subdirs, files in walk(startpath):
level = root.replace(startpath, '').count(sep)
indent = ' |' * (level-1) + ' +- '