Skip to content

Instantly share code, notes, and snippets.

View imdadahad's full-sized avatar

Imdad Ahad imdadahad

View GitHub Profile
@imdadahad
imdadahad / pre-hook
Created May 26, 2017 09:57
Git hook to run pycodestyle when committing to repo
#!/bin/bash
function display_result {
RESULT=$1
EXIT_STATUS=$2
TEST=$3
if [ $RESULT -ne 0 ]; then
echo -e "\033[31m$TEST failed\033[0m"
exit $EXIT_STATUS
else
@imdadahad
imdadahad / cloudSettings
Last active July 25, 2017 16:07
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-07-25T16:07:16.402Z","extensionVersion":"v2.8.2"}
@imdadahad
imdadahad / flaskapp.service
Created March 27, 2017 22:07
An upstart systemd service for running Flask with gunicorn
[Unit]
Description=Gunicorn instance to serve a flask api
After=network.target
[Service]
User=<user>
Group=www-data
WorkingDirectory=/home/<user>/flask_api
EnvironmentFile=/home/<user>/flask_api/.env # Specify app environment variables
Environment="PATH=/home/<user>/flask_api/venv/bin" # Ensure venv is setup
@imdadahad
imdadahad / loglive.sh
Created March 23, 2017 23:46
A live git log running in the foreground
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $*
sleep 200
done