Skip to content

Instantly share code, notes, and snippets.

View letsenncrypt_dns_hook.py
#! /usr/bin/env python3
# vim: set fileencoding=UTF-8
""" letsencrypt_dns_hook.py: Used as a hook script for dehydrated.sh during
validation for a given name to modify the route53 DNS records necessary to
provide proof of domain ownership.
"""
__author__ = "Zach Leslie"
__copyright__ = "Copyright 2016, OtoAnalytics"
View PHPtoICS.php
<?php
// Variables used in this script:
// $summary - text title of the event
// $datestart - the starting date (in seconds since unix epoch)
// $dateend - the ending date (in seconds since unix epoch)
// $address - the event's address
// $uri - the URL of the event (add http://)
// $description - text description of the event
// $filename - the name of this file for saving (e.g. my-event-name.ics)
//
View how-to-set-up-stress-free-ssl-on-os-x.md

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 destructuring.md

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors

@terretta
terretta / uninstall-macfuse-core.sh
Created August 3, 2013 19:51
Fix to uninstall script for MacFuse 2.1.7 on Lion and Mountain Lion. // If you're getting the error "MacFUSE Uninstaller: Can not find the Archive.bom for MacFUSE Core package." it's because MacFuse was installed on Snow Leopard or earlier and the uninstall script doesn't know where the bom (bill of materials) file is. Drop to your terminal, and…
View uninstall-macfuse-core.sh
OS_RELEASE=`/usr/bin/uname -r`
case "$OS_RELEASE" in
8*)
log "Incorrect uninstall. Use the Tiger version please."
exit 1
;;
9*)
PACKAGE_RECEIPT="$INSTALL_VOLUME/Library/Receipts/MacFUSE Core.pkg"
OUTER_PACKAGE_RECEIPT="$INSTALL_VOLUME/Library/Receipts/MacFUSE.pkg"
BOMFILE="$PACKAGE_RECEIPT/Contents/Archive.bom"
View gist:5437853
{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more}
useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
Thanks.|
View redcon.go
package main
import (
"log"
"io"
"os"
"crypto/tls"
"strings"
"net"
"flag"
@terretta
terretta / gist:4081758
Created November 15, 2012 22:16
Full List of Siri Comands
View gist:4081758
Full list of Siri Commands
Contacts
“What’s Michael’s address?”
“What is Susan Park’s phone number?”
“When is my wife’s birthday?”
“Show Jennifer’s home email address”
“Show Jason Russell”
“Find people named Park”
@terretta
terretta / latency.txt
Created May 31, 2012 15:15 — forked from jboner/latency.txt
Latency numbers every programmer should know
View latency.txt
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 25 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 3,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns
@terretta
terretta / hack.sh
Created March 31, 2012 13:59 — forked from erikh/hack.sh
OSX For Hackers
View hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#