Skip to content

Instantly share code, notes, and snippets.

@chbrown
chbrown / _upgrade-pg9.4-to-pg9.5.md
Last active October 7, 2021 13:57
Upgrade PostgreSQL 9.4 to 9.5 on Mac OS X with Homebrew

First, check your current config (example output in homebrew.mxcl.postgresql.plist.xml lower down in this gist):

cat ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

Most importantly, note the -D /usr/local/var/postgres argument.

Second, shut down your current PostgreSQL.

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
@chbrown
chbrown / example.md
Created August 31, 2016 23:20
Proper GFM nested lists

Break.

  • Root level
    • Second level
      • Third level
    • Back to second level

Break again.

  1. Root level
@chbrown
chbrown / email.html
Created November 24, 2015 04:28
FastMail newsletter (November 2015)
<html>
<head>
<title>New FastMail features and other news</title>
<style>
body { font: 15px/1.35 "Helvetica Neue", Arial, sans-serif; }
p { margin: 15px 0; }
ul { margin: 15px 30px; }
li { margin: 5px 0; }
a { color: #4b1923; }
#border { background: #44557e; padding: 0 15px 15px; border-radius: 4px; }
@chbrown
chbrown / main.clj
Created November 13, 2017 22:31
tools.trace-example
(ns main)
(defonce ^:private counter (atom 0))
(defn- interleave-with-reversed [s]
(interleave s (reverse s)))
(defn frobnicate [user]
(apply str (interleave-with-reversed user)))

Keybase proof

I hereby claim:

  • I am chbrown on github.
  • I am chbrown (https://keybase.io/chbrown) on keybase.
  • I have a public key ASDCAV-8Fgynhe6xekE4n1VpfYrVfJF-qdCzpPm9eNCiJgo

To claim this, I am signing this object:

@chbrown
chbrown / syslog-snippet.log
Created November 1, 2015 19:19
Bluetooth connection flakiness
2015-11-01 12:26:25.000 PM kernel[0]: **** [IOBluetoothHostControllerUSBTransport][InterruptReadHandler] -- Received kIOReturnNotResponding error - no more retries
2015-11-01 12:26:25.000 PM kernel[0]: **** [IOBluetoothHostControllerUSBTransport][DoDeviceReset] -- thread_call_enter1 (mReEnumerateOrResetThread) -- reEnumerateOrReset = 1 (ReEnumerate Module) -- returned FALSE -- 0xd000 ****
2015-11-01 12:26:25.000 PM kernel[0]: **** [IOBluetoothHostControllerUSBTransport][ReEnumerateOrResetThreadEntry] -- entering -- param0 = 0xd000, param1 = 0x0001 -- 0xd000
2015-11-01 12:26:25.000 PM kernel[0]: **** [IOBluetoothHostControllerUSBTransport][ReEnumerateOrReset] -- entering -- reEnumerateOrResetIn = 1 (ReEnumerate Module) -- this = 0xd000 ****
2015-11-01 12:26:25.000 PM kernel[0]: **** [IOBluetoothHostControllerUSBTransport][ReEnumerateOrReset] -- in our workloop -- 0xd000 ****
2015-11-01 12:26:25.000 PM kernel[0]: **** [IOBluetoothHostControllerUSBTransport][ReEnumerateOrReset] -- parameter is valid -- 0xd000
@chbrown
chbrown / vehiclepositions.pb
Created May 20, 2016 15:06
CapMetro Vehicle Positions PB File - Socrata API - Firewall Failure
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Barracuda Web Filter</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body content-type="text/plain; charset=UTF-8">
<span id="redir_msg" style="display: none"><p>Redirecting you to Barracuda Web Filter.</p></span><script x-barracuda="1" language="JavaScript">
@chbrown
chbrown / 1k_array.json
Last active April 29, 2016 17:08
Long array with random data generated by json-generator.com
This file has been truncated, but you can view the full file.
[
{
"_id": "5722e433413a839e80088639",
"index": 0,
"guid": "db33a728-66a3-481f-a71c-9f3ddbdfd4d5",
"isActive": false,
"balance": "$2,185.98",
"picture": "http://placehold.it/32x32",
"age": 25,
"eyeColor": "green",
@chbrown
chbrown / terminal_hist.py
Created October 27, 2013 04:15
Numpy-powered CLI histogram
import os
import numpy as np
term_rows, term_columns = map(int, os.popen('stty size', 'r').read().split())
def hist(xs, margin=10, width=term_columns):
# I'm not sure why my font in iterm doesn't like \u2588, but it looks weird.
# It's too short and not the right width.
chars = u' \u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2589'
@chbrown
chbrown / gist:6632529
Created September 20, 2013 02:15
Brown clefts, maybe perl -ne "/it was .+ (who|that)/i && print $1"
Several signers affixed their names, it was learned, after being told that no tax increase would be possible without consent of the General Assembly and that a provision could be included in the charter to have the town take over the Johnston Sanitary District sewer system.
It was generally agreed that the subject was important and the board should be informed on what was done, is going to be done and what it thought should be done.
It was the first of two doubles by Robinson, who was in a mood to celebrate.
It was a real stimulant to a lot of guys I know who have moved past the 2-score-year milestone.
It was neither a spirit of self-sacrifice nor a yen to encourage the downtrodden that motivated Arnold.
It was a nice round figure, that 12, he said as he headed for the clubhouse, not too much perturbed.
It was about that time, a board member said later, that Dr. Thomas G. Pullen, Jr., State superintendent of schools, told Dr. Jenkins and a number of other education officials that he would not talk to them wit