Skip to content

Instantly share code, notes, and snippets.

View philfreo's full-sized avatar

Phil Freo philfreo

View GitHub Profile
<!-- iPhone 6 Plus -->
<link href="startup-image-1242x2148.png"
media="(device-width: 414px) and (device-height: 736px)
and (-webkit-device-pixel-ratio: 3)"
rel="apple-touch-startup-image">
// ==UserScript==
// @name Gmail "From" Address auto-selector
// @version 0.18
// @description Looks in your "To" field and sees if you have an email address in your "From" addresses with the same domain. Changes <select> onblur
// @author Andrew Sutherland, https://github.com/asuth
// @include http://mail.google.com/*
// @include https://mail.google.com/*
// @include http://*.mail.google.com/*
// @include https://*.mail.google.com/*
// ==/UserScript==
@garnaat
garnaat / gist:1539859
Created December 30, 2011 13:28
Enable debug output with boto and EC2
# This will cause full debug output to go to the console
>>> import boto
>>> boto.set_stream_logger('foo')
>>> ec2 = boto.connect_ec2(debug=2)
@philfreo
philfreo / gist:3148064
Created July 20, 2012 01:21 — forked from mattheworiordan/gist:1037984
Backbone patch to defer update method requests when new create requests are not complete on a model
// Queue of Backbone.Model save()s so that we don't issue multiple POSTs while waiting for
// the first one to come back. The first save() will always POST and the second will always PUT now.
// https://github.com/documentcloud/backbone/issues/345
// https://gist.github.com/1037984 and https://gist.github.com/gists/3148064
(function() {
function proxyAjaxEvent(event, options, dit) {
var eventCallback = options[event];
options[event] = function() {
// check if callback for event exists and if so pass on request
if (eventCallback) { eventCallback(arguments) }
var Zap = {
new_client_pre_write: function(bundle) {
var data = {
status: bundle.request.data.status,
name: bundle.request.data.name,
description: '',
contacts: [
{
name: bundle.request.data.contacts__name
}
@anemitz
anemitz / drip_email.py
Created August 24, 2013 00:07
Send drip-style email through Close.io's API
#!/usr/bin/env python
import sys
import time
import codecs
import argparse
from pybars import Compiler
from closeio_api_client.api import CloseIO_API as CloseIO
____ ____ ___ ____ _ _ ____ _____ ____
| _ \ | _ \ / _ \ | _ \ | | | | / ___||_ _|/ ___|
| |_) || |_) || | | || | | || | | || | | | \___ \
| __/ | _ < | |_| || |_| || |_| || |___ | | ___) |
|_| |_| \_\ \___/ |____/ \___/ \____| |_| |____/
___ _ _
|_ _|| \ | |
| | | \| |
| | | |\ |
|___||_| \_|
@glenbot
glenbot / Git Issue Export for Pivotal
Created January 6, 2011 23:57
Export your open issues in github to a pivotal tracker friendly csv for import, requires github2 python api-client
import csv
from github2.client import Github
# api settings for github
git_username = 'your_git_username'
git_api_token = 'your_git_api_token'
git_repo = 'username/repo_name'
# import all issues as this story type
pivotal_story_type = 'Bug'
@tbveralrud
tbveralrud / submodule-update-fix-snippet.yml
Created January 21, 2016 00:20
(Temporary) Fix for submodule update error on CircleCI
# CircleCI failed to build a git submodule update step.
# Tracked it down to partially complete .git/modules existing in our source cache.
# This removes the .git/modules directory before the submodule update.
# The error:
# $ git submodule update --init
# git submodule update --init returned exit code 128
# fatal: Not a git repository: ../.git/modules/<project> Action failed: git submodule update --init
checkout:
@philfreo
philfreo / README.md
Last active August 8, 2016 02:29
SSL CSR & localhost self-signing

Generate a CSR for production use:

openssl req -nodes -newkey rsa:2048 -sha256 -keyout mysite-ssl.private-key.pem -out mysite-ssl.csr -subj '/C=US/ST=California/L=Palo Alto/O=My Company Inc./CN=*.example.com'

Generate a long-lasting self-signed cert & trust it for localhost development usage:

openssl req -nodes -newkey rsa:2048 -sha256 -x509 -days 3650 -keyout selfsigned.key -out selfsigned.crt -subj '/C=US/ST=Anywhere/L=Anywhere/O=Localhost/CN=local.example.com'