Skip to content

Instantly share code, notes, and snippets.

@jkirkell
jkirkell / how-to-set-up-stress-free-ssl-on-os-x.md
Created March 21, 2018 17:58 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
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

/**
* Adapted from https://github.com/Khan/react-components/blob/master/js/timeout-transition-group.jsx
*/
var React = require('react/addons');
var ReactTransitionGroup = React.addons.TransitionGroup;
var Velocity = require('velocity-animate');
var transitions = {
// Forcefeeding: property order = [after, before]
/**
* @fileoverview layout-vertical-two-page component definition
* @author lakenen
*/
/**
* The vertical-two-page layout
*/
Crocodoc.addComponent('layout-vertical-two-page', ['layout-' + Crocodoc.LAYOUT_VERTICAL], function (scope, vertical) {
/**
* @fileoverview layout-presentation-vertical component definition
* @author lakenen
*/
(function () {
var componentName = 'layout-presentation-vertical';
var mixins = [
'layout-' + Crocodoc.LAYOUT_PRESENTATION,
'layout-' + Crocodoc.LAYOUT_VERTICAL
var $;
if (typeof jQuery === 'undefined') {
if (typeof require === 'function') {
try {
$ = require('jquery');
} catch (err) {}
}
} else {
$ = jQuery;
}
Crocodoc.addDataProvider('page-offset', function (scope) {
return {
get: function (type, key) {
var $p, dp = scope.getDataProvider(type);
if (type === 'metadata') {
$p = dp.get(type);
return $p.then(function (data) {
data.numpages += 1;
var page,
exceptions = data.dimensions.exceptions,
<link rel="import" href="../chart-js/chart-js.html">
<link rel="import" href="../cool-clock/cool-clock.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<polymer-element name="my-element">

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results