Clone
git clone git@gist.github.com:faf373e5c05a8cb4bc49c048504dbea6.git git-hook-prepare-commit-msg
Clone
git clone git@gist.github.com:faf373e5c05a8cb4bc49c048504dbea6.git git-hook-prepare-commit-msg
| # Byte-compiled / optimized / DLL files | |
| __pycache__/ | |
| *.py[cod] | |
| *$py.class | |
| # C extensions | |
| *.so | |
| # Distribution / packaging | |
| .Python |
| import os | |
| import urllib2 | |
| import contextlib | |
| import StringIO | |
| from django.core.files.storage import get_storage_class, FileSystemStorage | |
| from django.core.files import File | |
| from django.conf import settings | |
| from galleries.models import GalleryImage |
| $ GET http://xyz.com/14015/forxxx | |
| <!DOCTYPE HTML> | |
| <html lang="en-US"> | |
| <head> | |
| <meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
| <meta charset="UTF-8"> | |
| <title>Just a moment...</title> | |
| <link rel="stylesheet" media="screen" href="/cdn-cgi/styles/js-challenge/error.css" type="text/css"> | |
| </head> | |
| <body> |
| import string | |
| def pretty_size(size): | |
| "size in bytes" | |
| size = int(size) | |
| units = ' KMGTPE'+string.lowercase[::-1] | |
| bytes = 'B' | |
| i = 0 | |
| while size>1024: |
| import math | |
| from collections import Counter | |
| from funcy import post_processing | |
| from parse import parse | |
| from scipy.optimize import minimize_scalar | |
| @post_processing(dict) | |
| def parse_input(input_str): |
| FROM python:3.7-slim-stretch AS builder | |
| RUN python -m pip install -U pip setuptools wheel pip-tools | |
| CMD ["/reqs/compile-all.sh"] |
Setup
pip install pytest==5.0.1 eventlet
See error
pytest --help | cat
| from itertools import count, takewhile | |
| from math import sqrt | |
| import time | |
| try: | |
| # Python 2 compat | |
| from itertools import ifilter as filter | |
| except ImportError: | |
| pass |
| function trigger(ename, elem){ | |
| if (!elem) { | |
| console.log("Cannot " + ename + " element missing"); | |
| } | |
| console.log("Trigger " + ename + " on " + elem); | |
| console.log(elem); | |
| var evt = document.createEvent("MouseEvents"); | |
| evt.initMouseEvent(ename, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); | |
| elem.dispatchEvent(evt) | |
| } |