This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| from multiprocessing import Process, Lock | |
| from time import sleep | |
| import sys | |
| from time import time | |
| def worker(lock, i, start, sleep_second): | |
| lock.acquire() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import cv2 | |
| VIDEO_PATH = 'video_src.mp4' | |
| def initVideo(): | |
| cap = cv2.VideoCapture(VIDEO_PATH) | |
| if(cap.isOpened() == False): | |
| print('Error opening video file') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| if getattr(sys, 'frozen', False): | |
| basedir = os.path.dirname(sys.executable) | |
| else: | |
| basedir = os.getcwd() | |
| print(basedir) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import datetime | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy import Column | |
| from sqlalchemy import VARCHAR | |
| from sqlalchemy import Integer | |
| from sqlalchemy import create_engine | |
| from sqlalchemy.orm import sessionmaker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from requests.adapters import HTTPAdapter | |
| from requests.packages.urllib3.poolmanager import PoolManager | |
| crt_path = '/path/secret.crt' | |
| url = 'https://127.0.0.1/api' | |
| # Never check any hostnames | |
| class HostNameIgnoringAdapter(HTTPAdapter): | |
| def init_poolmanager(self, connections, maxsize, block=False): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import tinify | |
| from PIL import Image | |
| tinify.key = "THIS IS MY KEY" | |
| orginal_path = r"ORIGINAL_DIR" | |
| compressed_path = r"COMPRESSED_DIR" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from tornado import web | |
| from tornado import websocket | |
| from tornado import ioloop | |
| from tornado.options import define, options | |
| from tornado.httpserver import HTTPServer | |
| from tornado.netutil import bind_unix_socket | |
| options.define('listen_port', group='webserver', default=1337, help='Listen port') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% extends "bootstrap/base.html" %} | |
| {% import "bootstrap/wtf.html" as wtf %} | |
| {% block title %}test{% endblock %} | |
| {% block content %} | |
| <div class="col-md-4"> | |
| <form action="" method="post" novalidata> | |
| {{ form.hidden_tag() }} | |
| <p> | |
| {{ form.example }}<br> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from bs4 import BeautifulSoup | |
| def auth(): | |
| url = "https://www.hackthis.co.uk/?login" | |
| data = {"username":"", | |
| "password":""} | |
| sess = requests.Session() | |
| sess.post(url, data=data) | |
| return sess |