This file contains hidden or 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
sudo certbot renew --agree-tos | |
sudo heroku _certs:add /etc/letsencrypt/live/www.domain.com/fullchain.pem /etc/letsencrypt/live/www.domain.com/privkey.pem |
This file contains hidden or 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 boto | |
>>> s3 = boto.connect_s3('<access_key>', '<secret_key>') | |
>>> bucket = s3.lookup('donebox-static') | |
>>> key = bucket.new_key('testkey') | |
>>> key.set_contents_from_string('This is a test') | |
>>> key.exists() | |
>>> key.delete() |
This file contains hidden or 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
box-shadow: 0px 2px 5px rgba(0, 0, 0, .25); |
This file contains hidden or 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
select trim(lower(email)), count(*) | |
from "users" | |
group by trim(lower(email)) | |
HAVING count(*) > 1 |
This file contains hidden or 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
find . -type f -print -delete |
This file contains hidden or 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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": "s3:*", | |
"Resource": [ | |
"arn:aws:s3:::bucket-name-here", | |
"arn:aws:s3:::bucket-name-here/*" | |
] |
This file contains hidden or 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 os.path import expanduser | |
from flask import Flask | |
from flask.ext.stormpath import StormpathManager, login_required | |
from flask_stormpath.models import user_created | |
app = Flask(__name__) | |
app.config['SECRET_KEY'] = 'xxx' | |
app.config['STORMPATH_API_KEY_FILE'] = expanduser('stormpath.properties') |
This file contains hidden or 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 __init__(self, *args, **kwargs): | |
Form.__init__(self, *args, **kwargs) | |
self.multipart = True |
This file contains hidden or 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 http://stackoverflow.com/questions/2830542/prevent-double-submission-of-forms-in-jquery | |
//usage: $('form').preventDoubleSubmission(); | |
//disable per form: $('form:not(.js-allow-double-submission)').preventDoubleSubmission(); | |
jQuery.fn.preventDoubleSubmission = function() { | |
$(this).on('submit',function(e){ | |
var $form = $(this); | |
if ($form.data('submitted') === true) { | |
// Previously submitted - don't submit again |
This file contains hidden or 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
^(?:https?:\/\/)?(?:www\.)?([^\/]+) |