Skip to content

Instantly share code, notes, and snippets.

@val360
val360 / how-to-set-up-stress-free-ssl-on-os-x.md
Created January 21, 2018 23:54 — 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

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Simple markers</title>
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
@val360
val360 / gist:10646092
Created April 14, 2014 13:05
keybase.io
### Keybase proof
I hereby claim:
* I am val360 on github.
* I am val (https://keybase.io/val) on keybase.
* I have a public key whose fingerprint is 8568 0420 120C 876E 7046 E41E 2FA7 5686 0F88 77A7
To claim this, I am signing this object:
@val360
val360 / gist:6442158
Created September 4, 2013 20:04
jvmtop shell script
#!/bin/sh
# jvmtop - java monitoring for the command-line
# launch script
#
# author: Markus Kolb
#
DIR=`cd "\`dirname "$0"\`" && pwd`
if [ -z "$JAVA_HOME" ] ; then

Install ImageMagick for image conversion:

brew install imagemagick

Install tesseract for OCR:

brew install tesseract --all-languages

Or install without --all-languages and install them manually as needed.

# start by setting FilterLoadOrder to the name of the filer you're about to create
cscript C:\Inetpub\AdminScripts\adsutil.vbs set W3SVC/1/Filters/FilterLoadOrder "Filter Name" #FIX!!! http://msdn.microsoft.com/en-us/library/ms524730(v=vs.90).aspx
# create new filter
cscript C:\Inetpub\AdminScripts\adsutil.vbs create W3SVC/1/Filters/"Filter Name" IIsFilter
# set FilterPath with the path to DLL
cscript C:\Inetpub\AdminScripts\adsutil.vbs set W3SVC/1/Filters/"Filter Name"/FilterPath "C:\Program Files\360Works\isapi_redirect.dll"
# set FilterDescription with a descriptive string

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@val360
val360 / get_container.php
Created November 28, 2012 18:52
Example, retrieving data from FileMaker container field
<?php
require_once ('FileMaker.php');
define ('FM_HOST', 'XXX.XXX.XXX.XXX');
define ('FM_FILE', 'file.fmp12');
define ('FM_USER', 'user');
define ('FM_PASS', 'pass');
$fm = & new FileMaker(FM_FILE, FM_HOST, FM_USER, FM_PASS);
@val360
val360 / speedmail.applescript
Created October 24, 2012 17:06 — forked from ttscoff/speedmail.applescript
Speed up Mail.app
(*
Speed up Mail.app by vacuuming the Envelope Index
Code from: http://www.hawkwings.net/2007/03/03/scripts-to-automate-the-mailapp-envelope-speed-trick/
Originally by "pmbuko" with modifications by Romulo
Updated by Brett Terpstra 2012 <http://brettterpstra.com>
*)
tell application "Mail" to quit
set sizeBefore to do shell script "ls -lah ~/Library/Mail/V2/MailData | grep -E 'Envelope Index$' | awk {'print $5'}"
do shell script "/usr/bin/sqlite3 ~/Library/Mail/V2/MailData/Envelope\\ Index vacuum"