Quick install (system-wide):
curl -fsSL https://gist.githubusercontent.com/11c9bc92e22505dfc2513e24791892d1/raw/gitls -o gitls && chmod +x gitls && sudo mv gitls /usr/local/bin/gitlsOr install to your user bin (no sudo required):
| import requests # version 1.2.3 | |
| import ssl | |
| from requests.adapters import HTTPAdapter, DEFAULT_POOLBLOCK | |
| from requests.packages.urllib3.poolmanager import PoolManager | |
| STREAK_API_KEY = 'USE-YOUR-API-KEY-HERE' | |
| # A Function to list all the python classes in a file | |
| function listclasses() | |
| { | |
| if [ -z "$1" ]; then | |
| F="models.py" | |
| else | |
| F="$1" | |
| fi | |
| cat $F | grep "^class " | sed "s/class //" | sed "s/(.*$//" | sort | |
| } |
| import hashlib | |
| import sys | |
| from concurrent.futures import ProcessPoolExecutor | |
| from time import sleep, time | |
| def t1(n): | |
| """Silly function whose time increases as n does.""" | |
| for i in range(n): |
| #!/usr/bin/env python | |
| """ | |
| Test if we can reliably figure out the uncompressed size of .gz file... | |
| """ | |
| import gzip | |
| import os | |
| import subprocess | |
| """ | |
| This script illustrates how to use sys.argv to | |
| capture command-line arguments. | |
| Dowload & run this file like so: | |
| python example.py | |
| OR like this: |
| #!/usr/bin/env python | |
| """ | |
| A quick & dirty hack to list all of your Gists sorted by stars. | |
| This script lists your gists, the number of stars, the number of comments, | |
| a truncated description, and the url for the gist. | |
| NOTE: This only returns public gists. If you want to see (your own) private gists, | |
| you can provide a personal access token. |
| #!/usr/bin/env python | |
| """ | |
| process some data | |
| """ | |
| from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor | |
| from joblib import Parallel, delayed | |
| import os | |
| import statistics |
| #!/usr/bin/env python | |
| """ | |
| Very simple HTTP server in python (Updated for Python 3.7) | |
| Usage: | |
| ./dummy-web-server.py -h | |
| ./dummy-web-server.py -l localhost -p 8000 | |
| Send a GET request: |