Skip to content

Instantly share code, notes, and snippets.

@xavierRiley
xavierRiley / gist:5433552
Created April 22, 2013 09:31
failing heroku buildpack
> git push staging staging:master
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 601 bytes, done.
Total 5 (delta 2), reused 0 (delta 0)
-----> Fetching custom git buildpack... done
! Heroku push rejected due to an unrecognized error.
@xavierRiley
xavierRiley / .irbrc
Created January 30, 2013 10:26 — forked from avsej/.irbrc
ARGV.concat ["--readline"]
$LOAD_PATH << "."
require 'rubygems'
require 'pp'
history_file = "#{ENV['HOME']}/.irb-history"
version = "#{RUBY_VERSION}"
if RUBY_DESCRIPTION =~ /Ruby Enterprise Edition (\d{4}\.\d{2})/
## Rails Upgrade check
#
# Check your github repos for out of date rails apps
#
# usage: $ USERNAME=yourusername PASSWORD=yourpassword ruby railscheck.rb
# or
# usage: $ USERNAME=yourusername PASSWORD=yourpassword ORG=yourorgname ruby railscheck.rb
#
# n.b requires the octokit gem
# >---------------------------------------------------------------------------<
#
# _____ _ _ __ ___ _
# | __ \ (_) | \ \ / (_) | |
# | |__) |__ _ _| |___\ \ /\ / / _ ______ _ _ __ __| |
# | _ // _` | | / __|\ \/ \/ / | |_ / _` | '__/ _` |
# | | \ \ (_| | | \__ \ \ /\ / | |/ / (_| | | | (_| |
# |_| \_\__,_|_|_|___/ \/ \/ |_/___\__,_|_| \__,_|
#
# This template was generated by RailsWizard, the amazing and awesome Rails
@xavierRiley
xavierRiley / index.txt
Created December 14, 2012 15:24 — forked from gus/index.txt
For each Ruby module/class, we have Ruby methods on the left and the equivalent
Clojure functions and/or relevant notes are on the right.
For clojure functions, symbols indicate existing method definitions, in the
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master,
ruby-to-clojure.*/* functions can be obtained from the source files in this
gist.
If no method symbol is given, we use the following notation:
@xavierRiley
xavierRiley / stream-tests.clj
Created December 14, 2012 12:52
Some ideas for the big scale exercise in Clojure
(defn remove-consecutive-duplicates [coll]
(let [shifted-coll (cons nil coll)]
(remove nil? (map (fn [x y] (if (not= x y) x)) coll shifted-coll))))
(remove-consecutive-duplicates
(seq
(filter even?
(take 32
(cycle
(concat
@xavierRiley
xavierRiley / index.txt
Created September 1, 2012 20:32 — forked from gus/index.txt
Ruby/Clojure analogs
For each Ruby module/class, we have Ruby methods on the left and the equivalent
Clojure functions and/or relevant notes are on the right.
For clojure functions, symbols indicate existing method definitions, in the
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master,
ruby-to-clojure.*/* functions can be obtained from the source files in this
gist.
If no method symbol is given, we use the following notation:
@xavierRiley
xavierRiley / gist:3426429
Created August 22, 2012 14:59 — forked from flyingmachine/gist:3390402
Installing Ruby after upgrading from Snow Leopard to Mountain Lion

After you've done the steps below it will be as if you did an upgrade rather than a clean install. Your home directory will be there, as will your applications.

  1. Back up system to an external HD (I used Super Duper)
  2. Install mountain lion clean: http://eggfreckles.net/notes/installing-mountain-lion-clean/
  3. At the end of the install, transfer files back from my external HD
  4. Remove everything in /usr/local with sudo rm -Rf /usr/local/*
  5. Follow these instructions: http://jfire.io/blog/2012/03/02/xcode-4-dot-3-homebrew-and-ruby/
  6. I had trouble with ree/1.8.7 so I had to follow these instructions: http://stackoverflow.com/questions/11664835/mountain-lion-rvm-install-1-8-7-x11-error/11666019#11666019
@xavierRiley
xavierRiley / clojure_scales.clj
Created August 10, 2012 13:05
Clojure experiment
(defn get-dir [x]
(let [penul (first (rest (reverse x)))])
(let [final (last x)])
(when (>
(first (rest (reverse x)))
(last x)) (print "down"))
(when (>
(last x)
(first (rest (reverse x)))) (print "up"))
For each Ruby module/class, we have Ruby methods on the left and the equivalent
Clojure functions and/or relevant notes are on the right.
For clojure functions, symbols indicate existing method definitions, in the
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master,
ruby-to-clojure.*/* functions can be obtained from the source files in this
gist.
If no method symbol is given, we use the following notation: