Skip to content

Instantly share code, notes, and snippets.

tushar babbar tusharbabbar

Block or report user

Report or block tusharbabbar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
tusharbabbar /
Last active Jan 29, 2018
Configurable retry wrapper in Python
import traceback
from functools import wraps
def retry(retries=5, quantum_backoff=5, exception=Exception):
def real_retry(func):
def wrapper(*args, **kwargs):
tries = 0
exc = None
while tries <= retries:
tusharbabbar /
Last active Apr 25, 2018
Setting up AngularJS dev env for Ubuntu
tusharbabbar /
Last active Aug 29, 2015
Flask with uWSGI behind Nginx

The Flask App --

from flask import Flask

app = Flask(__name__)

@app.route('/', methods=['GET'])
def hello():
  return 'HELLO WORLD'
View mongo_setup
sudo apt-key adv --keyserver hkp:// --recv 7F0CEB10
echo 'deb dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install -y mongodb-org
View venv_setup
sudo pip install virtualenv
sudo pip install virtualenvwrapper
export WORKON_HOME=~/Envs
source /usr/local/bin/
tusharbabbar /
Last active Aug 29, 2015
A simple mailer for geeks who don't like to leave their terminal. P.S. Can send attachments from terminal.
import smtplib, os
from email import Encoders
from email.Utils import COMMASPACE, formatdate
from email.MIMEText import MIMEText
from email.MIMEBase import MIMEBase
from email.MIMEMultipart import MIMEMultipart
import argparse
import sys
You can’t perform that action at this time.