Skip to content

Instantly share code, notes, and snippets.

@davidfic
davidfic / main.tf
Last active December 15, 2017 14:52
an example of using count to create N number of subnets without a lot of duplication
module "public_subnets" {
source = "modules/aws_public_subnet"
environment = "${var.environment}"
vpc_id = "${module.vpc.vpc_id}"
vpc_cidr = "${module.vpc.vpc_cidr}"
cidrs = "${var.public_subnets}"
availability_zones = "${join(",", data.aws_availability_zones.available.names)}"
}
{
"variables": {
"aws_access_key": "",
"aws_secret_key": "",
"region": "",
"vpc_id": "",
"subnet_id": "",
"security_group_ids": "",
"source_ami": "",
"ssh_username": "",
@davidfic
davidfic / views.py
Created September 27, 2013 17:09
Basic setup for views.py
from flask import flash, redirect,render_template, send_file, request,session,g
from app import app
# add routes below
@davidfic
davidfic / __init__.py
Created September 27, 2013 15:41
Basic Flask __init__.py file
from flask import Flask
from flask.ext.debugtoolbar import DebugToolbarExtension
app = Flask(__name__)
from app import views, models
app.jinja_env.globals['get_resource_as_string'] = get_resource_as_string
# def debug():
@davidfic
davidfic / run.py
Created September 27, 2013 15:38
Basic Flask run.py file
#!/usr/bin/env python
from app import app
app.run(debug= True, host='0.0.0.0')
@davidfic
davidfic / 0_reuse_code.js
Created September 27, 2013 15:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@davidfic
davidfic / gist:4658286
Created January 28, 2013 19:27 — forked from padolsey/gist:527683
HTML: detect IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@davidfic
davidfic / gist:4648925
Last active December 11, 2015 19:29
HTML: flask template base
{% extends "base.html" %}
{% block content %}
{% endblock %}
@davidfic
davidfic / bootstrap.css
Last active December 11, 2015 17:38
CSS: bootstrap full
/*!
* Bootstrap v2.2.2
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/
@davidfic
davidfic / gist:4631216
Created January 25, 2013 02:28
HTML: span 1-12
.span12 {
width: 940px;
}
.span11 {
width: 860px;
}
.span10 {
width: 780px;