Skip to content

Instantly share code, notes, and snippets.

Tim McGilchrist tmcgilchrist

Block or report user

Report or block tmcgilchrist

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View git-rebase.markdown

Checkout a new working branch

 git checkout -b <branchname>

Make Changes

 git add
 git commit -m "description of changes"

Sync with remote

tmcgilchrist / prismatic.hs
Created Nov 27, 2018 — forked from parsonsmatt/prismatic.hs
I figured out a nice way to pluck exceptions out of a constraint!
View prismatic.hs
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
tmcgilchrist / gist:1271716
Created Oct 8, 2011
Personal Mercurial Workflow
View gist:1271716

Mercurial Workflow

Clone -> Edit -> Commit -> Push -> Update

hg clone        => Clone a remote repo

hg clone project_dir new_changes_dir      => Clone a local repo

hg commit -m "Message"                    => Commit locally changed files.

Programming Achievements: How to Level Up as a Developer

  1. Select a particular experience to pursue.
  2. Pursue that experience to completion. (Achievement unlocked!)
  3. Reflect on that experience. Really soak it in. Maybe a blog post would be in order?
  4. Return to Step 1, this time selecting a new experience.

This gist is a fork of the gist from this blog post.

tmcgilchrist / Battleship.lhs
Created Jul 30, 2017 — forked from ChrisPenner/Battleship.lhs
Hit! You sunk my Adjunction!
View Battleship.lhs
Today we'll be looking into Kmett's
[adjunctions]( library,
particularly the meat of the library in Data.Functor.Adjunction.
This post is a literate haskell file, which means you can load it right up in
ghci and play around with it! Like any good haskell file we need half a dozen
language pragmas and imports before we get started.
> {-# language DeriveFunctor #-}
> {-# language TypeFamilies #-}
tmcgilchrist /
Last active May 24, 2017
Release the hounds aka Push package to Hackage

Releasing to Hackage

  1. Create PR bumping version number
  2. Ensure it's building on CI
  3. Bump version in *.cabal file
  4. Commit new version to repo and push
  5. cabal sdist to generate a package
  6. cabal upload dist/pkg-x.y.x.tar.gz
  7. tag repo with this version
  8. Upload haddock changes
tmcgilchrist / gist:1271705
Created Oct 8, 2011
Personal Git Workflow
View gist:1271705

Git Workflow

Basic workflow I've been following, inspired by the RailsTutorial website.

Branch -> Edit -> Commit -> Merge -> Push

git init        => Create a new repository in the current directory

git add         => Add file to current changeset.
tmcgilchrist / gist:1103621
Created Jul 25, 2011
Rails 3 Setup for Oracle 10g XE
View gist:1103621

Notes on Setting up Oracle 10g XE with Rails

Capturing my notes about setting up an Oracle 10g XE / Rails environment for development work. Tested using the following versions, others may work as well:

  1. Ubuntu 11.04
  2. Ruby 1.9.2
  3. Rails 3
  4. Oracle 10 XE
tmcgilchrist / gist:1026467
Created Jun 15, 2011
Installing pg gem on Snow Leopard
View gist:1026467
Install pg gem on Snow Leopard for PostgreSQL 9.
Run the following commands.
sudo port install postgresql90-server -universal
gem install pg -- --with-pg-config=/opt/local/lib/postgresql90/bin/pg_config
View lisp.rb
# 30 minutes Lisp in Ruby
# Hong Minhee <>
# This Lisp implementation does not provide a s-expression reader.
# Instead, it uses Ruby syntax like following code:
# [:def, :factorial,
# [:lambda, [:n],
# [:if, [:"=", :n, 1],
# 1,
You can’t perform that action at this time.