Skip to content

Instantly share code, notes, and snippets.

View tmcgilchrist's full-sized avatar
🐫

Tim McGilchrist tmcgilchrist

🐫
View GitHub Profile
@tmcgilchrist
tmcgilchrist / lisp.rb
Created February 28, 2011 21:55 — forked from dahlia/lisp.rb
# 30 minutes Lisp in Ruby
# Hong Minhee <http://dahlia.kr/>
#
# 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,
@tmcgilchrist
tmcgilchrist / gist:1026467
Created June 15, 2011 04:15
Installing pg gem on Snow Leopard
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
@tmcgilchrist
tmcgilchrist / gist:1103621
Created July 25, 2011 05:40
Rails 3 Setup for Oracle 10g XE

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
tmcgilchrist / gist:1271705
Created October 8, 2011 01:03
Personal Git Workflow

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
tmcgilchrist / gist:1271716
Created October 8, 2011 01:24
Personal Mercurial Workflow

Mercurial Workflow

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

hg clone http://bitbucket.org/repo        => Clone a remote repo

hg clone project_dir new_changes_dir      => Clone a local repo

hg commit -m "Message"                    => Commit locally changed files.
@tmcgilchrist
tmcgilchrist / git-rebase.markdown
Created February 10, 2012 02:58
Git rebase workflow

Checkout a new working branch

 git checkout -b <branchname>

Make Changes

 git add
 git commit -m "description of changes"

Sync with remote

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
tmcgilchrist / stack.ml
Created May 18, 2014 22:24
Stack Data Type from Purely Function Data Structures.
module type Stack =
sig
type 'a t
val empty : 'a t
val isEmpty : 'a t -> bool
val cons : 'a -> 'a t -> 'a t
val head : 'a t -> 'a
val tail : 'a t -> 'a t
end
```
___
| |
| |
-------------------
-------------------
| ___ | ___ |
| | | | | | | | |
| |-+-| | |-+-| |
| |_|_| | |_|_| |
> cat ~/.sbt/0.13/plugins/plugins.sbt
resolvers += Resolver.sonatypeRepo("snapshots")
addSbtPlugin("org.ensime" % "ensime-sbt" % "0.1.5-SNAPSHOT")
> sbt gen-ensime
[info] Loading global plugins from /Users/tim/.sbt/0.13/plugins
[info] Loading project definition from /Users/tim/code/scala/introduction-to-fp-in-scala/project
[info] Set current project to introduction-to-fp-in-scala (in build file:/Users/tim/code/scala/introduction-to-fp-in-scala/)
[error] Not a valid command: gen-ensime