Skip to content

Instantly share code, notes, and snippets.

View ariejan's full-sized avatar

Ariejan de Vroom ariejan

View GitHub Profile
Running Jasmine specs...
.
PASS: 1 test, 0 failures, 0.005 secs.
def sort(elements)
return elements if elements.size <= 1
return elements if elements[0] < elements[1]
[elements[1], elements[0]]
end
describe "sort" do
example "empty array => empty array" do
sort([]).should == []
@ariejan
ariejan / .janus.rake
Created October 19, 2011 13:08
Place in ~/.janus.rake
skip_vim_plugin "color-sampler"
skip_vim_plugin "conque"
skip_vim_plugin "fugitive"
skip_vim_plugin "git"
skip_vim_plugin "taglist"
skip_vim_plugin "unimpaired"
skip_vim_plugin "pep8"
source 'http://rubygems.org'
gem 'rails', '3.1.0'
gem 'rack', '1.3.3'
group :assets do
gem 'sass-rails', "~> 3.1.0.rc"
gem 'coffee-rails', "~> 3.1.0.rc"
gem 'uglifier', "1.0.0"
gem 'compass', '~> 0.12.alpha'
@ariejan
ariejan / mail.txt
Created October 17, 2011 07:12
Birthday mail
We could have sent you a birthday card. We could have sent you some flowers or a cake.
But we didn't.
We could have even sent you one of those automatically generated messages to wish you happy birthday where we don't even have to replace INSERT NAME.
But we didn't
We wrote this birthday greeting just for you.
@ariejan
ariejan / content.rb
Created October 12, 2011 10:43
Some useful content-related methods (summaries, markdown, syntax highlighting)
require 'rdiscount'
require 'nokogiri'
require 'coderay'
module Falcon
class Content
# Return a summary if a delimiter is found, otherwise
# return the full body.
def self.summary_of(text, delimiter = "~\n")
summary = if text =~ /#{delimiter}/i
@ariejan
ariejan / gist:1203579
Created September 8, 2011 14:47 — forked from brianjlandau/gist:176754
Rails Capistrano deploy using git as our deployment strategy. You'll need git version >=1.5.6.6 on your server for this to work.
# you'd obviously have more settings somewhere
set :scm, :git
set :repository, "[email protected]:defunkt/github.git"
set :branch, "origin/master"
set :migrate_target, :current
set :use_sudo, false
set :ssh_options, {:forward_agent => true}
set :rails_env, 'production'
set(:latest_release) { fetch(:current_path) }
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
Falcon::Application.load_tasks
@ariejan
ariejan / install.txt
Created May 12, 2011 08:04
Location of `install`
ruby-1.8.7-p249 ~ λ which install
/usr/local/bin/install
ruby-1.8.7-p249 ~ λ cd /usr/local/bin
ruby-1.8.7-p249 /usr/local/bin master λ ls -lah install*
lrwxrwxrwx 1 ariejan staff 15B 20 Apr 13:08 install -> ./[email protected]
lrwxrwxrwx 1 ariejan staff 51B 20 Apr 13:08 [email protected] -> ../lib/node/.npm/brequire/0.0.5/package/bin/install
ruby-1.8.7-p249 /usr/local/bin master λ
@ariejan
ariejan / doctor.txt
Created May 6, 2011 09:33
Problem installing git 1.7.5.x
λ brew doctor
Some "config" scripts were found in your path, but not in system or Homebrew folders.
`./configure` scripts often look for *-config scripts to determine if software packages
are installed, and what additional flags to use when compiling and linking.
Having additional scripts in your path can confuse software installed via Homebrew if
the config script overrides a system or Homebrew provided script of the same name.
/Users/ariejan/.rvm/gems/ruby-1.8.7-p249/bin