This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2015-05-20 19:56:18 -0700 | |
./configure | |
--disable-debug | |
--disable-dependency-tracking | |
--prefix=/usr/local/Cellar/phash/0.9.6_1 | |
--enable-shared | |
checking for a BSD-compatible install... /usr/bin/install -c | |
checking whether build environment is sane... yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2015-04-13 16:58:39 -0700 | |
./configure | |
--disable-debug | |
--disable-dependency-tracking | |
--prefix=/usr/local/Cellar/phash/0.9.6_1 | |
--enable-shared | |
checking for a BSD-compatible install... /usr/bin/install -c | |
checking whether build environment is sane... yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package models | |
type TokenAPI interface { | |
GetTokenById(id string) (*Token, error) | |
CreateToken(userId string) (token *Token, err error) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Let's say you want to deploy a PostgreSQL database | |
Is it better to? | |
1) Use Ansible to install and configure PostgreSQL via an Ansible Playbook role | |
2) Use Ansible, Terraform, or CloudFormation's AWS RDS provisioner to set up a | |
PostgreSQL RDS instance | |
3) Use Terraform or Ansible to provision an instance and run shell commands to | |
install a PostgreSQL docker image | |
4) Use Packer to set up a machine image that has PostgreSQL installed, and | |
deploy that using Ansible, Terraform, or CloudFormation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var UndoMixin = { | |
getInitialState: function() { | |
return { | |
undo: [] | |
}; | |
}, | |
handleUndo: function() { | |
if (this.state.undo.length === 0) { | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @jsx React.DOM */ | |
var ReactDropzone = React.createClass({ | |
componentDidMount: function() { | |
var options = {}; | |
for (var opt in Dropzone.prototype.defaultOptions) { | |
var prop = this.props[opt]; | |
if (prop) { | |
options[opt] = prop; | |
continue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess | |
from sqlalchemy import Column, String, Integer, Float, MetaData, Table | |
from sqlalchemy import create_engine | |
from alchimia import TWISTED_STRATEGY | |
from flask import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
from django.template import Context, loader | |
from django.core.mail import send_mail | |
def send_template_mail(slug, context, recipient_list, from_email=settings.DEFAULT_FROM_EMAIL): | |
if isinstance(recipient_list, basestring): | |
recipient_list = [recipient_list] | |
if not isinstance(context, Context): | |
context = Context(context) | |
subject_tmpl = loader.get_template('mail/%s/subject.txt' % (slug,)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import httplib | |
import base64 | |
import contextlib | |
import simplejson | |
import urllib | |
from django.conf import settings | |
def stripe_fetch(resource, method='GET', params=None, secret=settings.STRIPE_SECRET, prefix='/v1'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_and_update_or_create(model, unique, update): | |
""" | |
Given a model, a dictionary of lookup arguments, and a dictionary of update | |
arguments, this convenience function gets an object and updates it in the | |
database if necessary. | |
Returns a tuple (object, int) where int is 0 if the object was not updated, | |
1 if the object was created, and 2 if the object was updated in the | |
database. |