Skip to content

Instantly share code, notes, and snippets.

@dmdeller
dmdeller / mailrules.json
Last active December 8, 2023 03:53
Fastmail rules to filter useless delivery emails
[
{
"markFlagged": false,
"fileIn": "Deliveries",
"combinator": "any",
"snoozeUntil": null,
"discard": false,
"created": "2023-07-25T14:15:44Z",
"previousFileInName": null,
"name": "Useless delivery notifications",
@dmdeller
dmdeller / gist:de8c96d7ff99300dcca1df762aec0479
Last active April 18, 2016 16:11 — forked from joho/gist:3735740
PostgreSQL 9.2 upgrade steps

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
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.
'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
#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

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)
__weak __typeof__(foo) weakFoo = foo;
foo.block = ^
{
[weakFoo doSomething];
};
@dmdeller
dmdeller / HNCSVParser.h
Created July 20, 2013 20:25
CHCSVParser with blocks
//
// 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)
Bad:
<html>
<body>
<p>
Hello there,
<?php if (!empty($name)) { ?>
<?php echo $name; ?>
<?php } else { ?>
whoever