Skip to content

Instantly share code, notes, and snippets.

View ipapaioannou83's full-sized avatar

Yiannis Papaioannou ipapaioannou83

  • Heriot Watt University
View GitHub Profile
@ipapaioannou83
ipapaioannou83 / .gitignore
Created June 16, 2020 07:05
.gitignore template for Python
# All credits go to https://gist.github.com/GhostofGoes/94580e76cd251972b15b4821c8a06f59
# Editors
.vscode/
.idea/
# Vagrant
.vagrant/
# Mac/OSX
@ipapaioannou83
ipapaioannou83 / flask_gunicorn_app.py
Created March 20, 2020 12:37 — forked from KatiRG/flask_gunicorn_app.py
Running Flask with Gunicorn
# This gist shows how to integrate Flask into a
# custom Gunicorn-WSGI application described
# here: http://docs.gunicorn.org/en/stable/custom.html
from __future__ import unicode_literals
import multiprocessing
import gunicorn.app.base
@ipapaioannou83
ipapaioannou83 / print_progress.py
Created January 18, 2019 11:49 — forked from aubricus/License
Python Progress Bar
# -*- coding: utf-8 -*-
# Print iterations progress
def print_progress(iteration, total, prefix='', suffix='', decimals=1, bar_length=100):
"""
Call in a loop to create terminal progress bar
@params:
iteration - Required : current iteration (Int)
total - Required : total iterations (Int)
@ipapaioannou83
ipapaioannou83 / proxy-toggle.sh
Created February 20, 2018 13:14 — forked from dgoguerra/proxy-toggle.sh
Script to toggle Mac OS X SOCKS proxy, and setup a SOCKS server with SSH
#!/bin/sh
source server_info
PROXY_INTERFACE="Wi-Fi"
PROXY_HOST=127.0.0.1
PROXY_PORT=$SERVER_PORT
# A host where ssh can login without interaction, with a key-based
# authentication.
SOCKS_PROC_USER=$SERVER_USERNAME
SOCKS_PROC_HOST=$SERVER_IP
@ipapaioannou83
ipapaioannou83 / br.sh
Created August 12, 2017 20:37 — forked from dmkash/br.sh
Shell Script for tmux setup
#!/bin/sh
SESSION_NAME="big_red"
cd ~/Sites/within3/big_red
tmux has-session -t ${SESSION_NAME}
if [ $? != 0 ]
then