Skip to content

Instantly share code, notes, and snippets.


Damon Jablons blackrobot

View GitHub Profile
blackrobot /
Created Jan 31, 2018 — forked from jed/
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

View findbar.css
@namespace url("");
@keyframes scale-in {
0% {
transform: scaleY(0);
100% {
transform: scaleY(1);
blackrobot /
Created Dec 7, 2017 — forked from koop/
Ensures a certificate is in the macOS system keychain.
# Usage
# $ ./ "/path/to/cert"
# First, grab the SHA-1 from the provided SSL cert.
CERT_SHA1=$(openssl x509 -in "$CERT_PATH" -sha1 -noout -fingerprint | cut -d "=" -f2 | sed "s/://g")
# Next, grab the SHA-1s of any certs in the keychain.
# Don't return an error code if nothing is found.
blackrobot /
Created Sep 27, 2017 — forked from rcoup/
Parallel-ise an rsync transfer when you want multiple concurrent transfers happening,
set -e
# Usage:
# [--parallel=N] [rsync args...]
# Options:
# --parallel=N Use N parallel processes for transfer. Defaults to 10.
# Notes:
# List unique values in a DataFrame column
# Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
# Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(valuelist)]
blackrobot / Dockerfile
Last active May 5, 2016 — forked from ncherro/Dockerfile
View Dockerfile
FROM ruby:2.2
RUN apt-get update && apt-get install --no-install-recommends -y \
build-essential \
nodejs \
libpq-dev \
libxml2-dev \
libxslt1-dev \
libqt4-webkit \
libqt4-dev \
View pedantically_commented_playbook.yml
# ^^^ YAML documents must begin with the document separator "---"
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
View gunicorn-upstart.conf
# This runs gunicorn-django for; to install:
# * sudo ln -s <this file> /etc/init/example_com
# * sudo initctl reload-configuration
# to use:
# * sudo start/stop/restart/reload/status example_com
description " gunicorn instance"
start on runlevel [2345]
stop on runlevel [06]
View gist:2727166
garden = Garden.objects.get(slug='garden')
season = Season.objects.get(slug='summer')
garden.plants.filter( <<====
blackrobot / eggnog.js
Created Oct 24, 2011 — forked from kayluhb/eggnog.js
eggnog code
View eggnog.js
var eggYolks = 12,
lbsSugar = 1,
cupsRum = 2,
cupsBourbon = 2,
quartsWhippingCream = 2,
eggWhites = 12,
nutmeg = "sprinkle";
var eggNog = [eggYolks, lbsSugar, cupsRum,
cupsBourbon, quartsWhippingCream,