Skip to content

Instantly share code, notes, and snippets.

View robertpostill's full-sized avatar

Robert Postill robertpostill

View GitHub Profile
#!/bin/sh
# Shmaelessly ripped from http://www.robbyonrails.com/articles/2008/12/11/lighthouse-tickets-and-git-branching
#
# Will append the current pivotal tracker ticket number to the commit message automatically
# when you use the PT_* branch naming convention.
#
# Drop into .git/hooks/commit-msg
# chmod +x .git/hooks/commit-msg
@robertpostill
robertpostill / sicp-1_3-part1.scm
Created November 5, 2010 07:31
First part of SICP exercise 1.3
(define (largest-of-the-two x y)
(if (>= x y)
x
y))
@robertpostill
robertpostill / sicp-1_1-part1.scm
Created November 5, 2010 13:33
My answer to part of exercise 1.1. in SICP
(* (cond ((> a b) a)
((< a b) b)
(else -1))
(+ a 1))
@robertpostill
robertpostill / sicp-1_3-part2.scm
Created November 6, 2010 04:27
Second part of SICP exercise 1.3
(define (largest-of-the-two? x y)
(if (= (largest-of-the-two x y) x)
true
false))
(define (larger-than-thou x y z)
(if (and
(largest-of-the-two? x y)
(largest-of-the-two? x z))
@robertpostill
robertpostill / sicp-1_3-part3.scm
Created November 6, 2010 04:45
Third part of SICP exercise 1.3
(define (smallest-of-the-two x y)
(if (<= x y)
x
y))
(define (smallest-of-the-two? x y)
(if (= (smallest-of-the-two x y) x)
true
false))
@robertpostill
robertpostill / sicp-1_3-refactored.scm
Created November 6, 2010 05:03
Refactored solution for SICP exercise 1.3
(define (sum-of-the-larger-two a b c)
(define remainder (min a b c))
(define subtotal (apply + (list a b c)))
(- subtotal remainder))
@robertpostill
robertpostill / sicp-1_2.scm
Created November 6, 2010 05:44
An attempt to pretty print my answer to exercise 1.2 of SICP
(define exercise1-2
(/
( + 5 4
(- 2
(-3
(+ 6 0.8))))
(* 3
(- 6 2)
(- 7 2))))

Keybase proof

I hereby claim:

  • I am robertpostill on github.
  • I am robertpostill (https://keybase.io/robertpostill) on keybase.
  • I have a public key whose fingerprint is 4CA9 5B2B 82FF D9AE 1DA7 D5A3 9C5B F2D8 B307 F66B

To claim this, I am signing this object:

#+BEGIN_HTML
---
layout: post
---
#+END_HTML
@robertpostill
robertpostill / org-mode-example2
Created July 7, 2015 08:05
org mode quoting jekyll code snippet
#+BEGIN_HTML
{% highlight ruby %}
def show
@widget = Widget(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @widget }
end
end