Skip to content

Instantly share code, notes, and snippets.

@zaccrites
zaccrites / app.py
Last active February 16, 2023 04:57
Flask Application Factory
import jinja2
from flask import Flask, render_template, request, redirect, url_for
from flask.ext.sqlalchemy import SQLAlchemy
from . import formatting
from .config import get_config
db = SQLAlchemy()
@zaccrites
zaccrites / gist:c74c98b7a1c45d9d3ce6
Last active August 29, 2015 14:19
Fizzbuzz By a Python Generator Expression
#!/usr/bin/env python
fizzbuzz = (
('fizz' if i % 3 == 0 else '') + ('buzz' if i % 5 == 0 else '') + (str(i) if i % 3 and i % 5 else '')
for i in xrange(1, 100 + 1)
)
for entry in fizzbuzz:
print entry
@zaccrites
zaccrites / git-2.3.0-install.sh
Created February 19, 2015 13:37
Downloads and installs Git 2.3.0 from source on Ubuntu
#!/bin/bash
# Make sure to run as root.
apt-get install -y libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev
cd ~
mkdir git
cd git
wget https://github.com/git/git/archive/v2.3.0.tar.gz