Skip to content

Instantly share code, notes, and snippets.

View cddr's full-sized avatar

Andy Chambers cddr

View GitHub Profile
@cddr
cddr / pre-commit
Created April 1, 2014 02:14
Git precommit hook for keeping Changelog up-to-date
#!/bin/sh
# MVP precommit hook that keeps the Changelog up-to-date.
#
# Assumes that `pwd` is the project root
./scripts/gitlog-to-changelog >Changelog
git add Changelog
@cddr
cddr / pre-commit
Created April 1, 2014 02:14
Git precommit hook for keeping Changelog up-to-date
#!/bin/sh
# MVP precommit hook that keeps the Changelog up-to-date.
#
# Assumes that `pwd` is the project root
./scripts/gitlog-to-changelog >Changelog
git add Changelog
@cddr
cddr / fixup-whitespace
Created April 1, 2014 19:43
Fix whitespace before commit
git diff HEAD --no-color > /tmp/stage.diff
git apply -R /tmp/stage.diff
git apply --whitespace=fix /tmp/stage.diff

Keybase proof

I hereby claim:

  • I am cddr on github.
  • I am cddr (https://keybase.io/cddr) on keybase.
  • I have a public key whose fingerprint is 64E1 19C6 8F72 F2C4 E650 F321 4093 000D 8C99 8B18

To claim this, I am signing this object:

@cddr
cddr / selfied
Created April 7, 2014 17:08
Infinite selfie power
# Lets thank Arnold for the headphones!
#
# Next time you're doing coding hours, get your headphones on and
# run this script in a terminal.
#
# Usage:
#
# 1. Download imagesnap from here: https://github.com/rharder/imagesnap
# 2. Update the global variables below according to where you put imagesnap
# and where you'd like the images to show up
(defn encrypt [attr]
(reify
clojure.lang.Named
(getNamespace [this]
(.getNamespace attr))
(getName [this]
(.getName attr))
clojure.lang.IFn
(invoke [_ obj]
@cddr
cddr / dept.clj
Last active August 29, 2015 14:15
(defentity Department
:schema {:id Int
:name Str}
:uniqueness {:id :db.unique/identity})
@cddr
cddr / emp.clj
Created February 12, 2015 16:09
(defentity Employee
:schema {:id Int, :name Str}
:links [(link :department [Department :id])]
:uniqueness {:id :db.unique/identity})
(defentity Cart
:schema {:id Int
:name Str
:items [{:id Int
:qty Int
:price Num}]}
:uniqueness {:id :db.unique/identity})
@cddr
cddr / Emacs.md
Last active August 29, 2015 14:19

Setting up Emacs daemon on OS X

Tired of waiting for emacs to start on OS X? This step by step guide will teach you how to install the latest version of emacs and configure it to start in the background (daemon mode) and use emacsclient as your main editor.

Install Homebrew

First you'll need to install the [Homebrew package manager][brew] if yo haven't already. It is amazing.