Skip to content

Instantly share code, notes, and snippets.

@dmdeller
dmdeller / gist:de8c96d7ff99300dcca1df762aec0479
Last active April 18, 2016 16:11 — forked from joho/gist:3735740
PostgreSQL 9.2 upgrade steps
View gist:de8c96d7ff99300dcca1df762aec0479

Steps to upgrade a database from PostgreSQL 9.4 to PostgreSQL 9.5 using Homebrew (Mac OS X)

Notes:

  • I don't use launchd to run Postgres.
  • I don't have Homebrew installed in /usr/local, so I'm using commands that should work regardless of where it is installed.

This assumes you have already upgraded to 9.5 and got the fatal error trying to use your 9.4 database.

We need to have both 9.4 and 9.5 installed, so reinstall the old version.

@dmdeller
dmdeller / gist:4c71027faf8a0f45db30
Created August 15, 2014 17:25
Uninstall all ruby gems
View gist:4c71027faf8a0f45db30
for gem in $(gem list | cut -d" " -f1); do gem uninstall -aIx $gem; done
@dmdeller
dmdeller / gulpfile.js
Created August 8, 2014 21:02
My Gulpfile, based on generator-gulp-webapp, with added Coffee and options.
View gulpfile.js
'use strict';
// generated on 2014-08-08 using generator-gulp-webapp 0.1.0
var gulp = require('gulp');
// load plugins
var $ = require('gulp-load-plugins')();
var mainBowerFiles = require('main-bower-files');
// config
@dmdeller
dmdeller / gist:ad8a1d76bb00e3784820
Last active August 29, 2015 14:04
Import seeds into Core Data
View gist:ad8a1d76bb00e3784820
#pragma mark - Core Data
- (void)setupCoreData
{
[MagicalRecord setupAutoMigratingCoreDataStack];
if (SearchEngine.MR_countOfEntities == 0)
{
[self importSeeds];
}
@dmdeller
dmdeller / keybase.md
Last active September 19, 2017 23:40
View keybase.md

Keybase proof

I hereby claim:

  • I am dmdeller on github.
  • I am dmdeller (https://keybase.io/dmdeller) on keybase.
  • I have a public key whose fingerprint is 1872 D86F D9E4 2038 48FA DB43 4DF5 4ADF A8BD 32F9

To claim this, I am signing this object:

@dmdeller
dmdeller / 1_before.m
Last active August 29, 2015 13:57
Trying to avoid having ugly weakBlah variables all over the place to avoid retain cycles (or at least having to look at them)
View 1_before.m
__weak __typeof__(foo) weakFoo = foo;
foo.block = ^
{
[weakFoo doSomething];
};
@dmdeller
dmdeller / HNCSVParser.h
Created July 20, 2013 20:25
CHCSVParser with blocks
View HNCSVParser.h
//
// HNCSVParser.h
// HNCSVParser
//
// Created by David on 7/20/13.
// Copyright (c) 2013 David Deller. MIT Licensed.
//
#import <CHCSVParser/CHCSVParser.h>
@dmdeller
dmdeller / gist:5126198
Created March 9, 2013 23:09
Justification of colon-style conditionals in PHP (as much as you can justify anything about PHP)
View gist:5126198
Bad:
<html>
<body>
<p>
Hello there,
<?php if (!empty($name)) { ?>
<?php echo $name; ?>
<?php } else { ?>
whoever
@dmdeller
dmdeller / rss.xml
Last active December 14, 2015 10:39
View rss.xml
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>Steven Frank's Posts</title>
<description>Hello, I'm Steven, co-founder of Panic and technology enthusiast.</description>
<link>http://stevenf.com/posts</link>
<item>
<title>Thoughts on the Microsoft Surface Pro</title>
<link>http://stevenf.com/posts/surface-pro</link>