This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bats | |
load test_helper | |
setup() { | |
load_fixture rehash | |
} | |
teardown() { | |
destroy_fixture |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <stdio.h> | |
#include <sys/param.h> | |
#include <stdlib.h> | |
char *relative_prefix(char *argv0, char *prefix) { | |
char *file_name, *result; | |
size_t size; | |
if (argv0 == NULL) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ time rbenv install 1.9.2-p290 | |
Downloading https://github.com/downloads/sstephenson/ruby-packages/1.9.2-p290.x86_64-darwin.rubypackage... | |
Installing 1.9.2-p290... | |
Installed 1.9.2-p290 to /Users/sam/.rbenv/versions/1.9.2-p290 | |
real 0m18.979s | |
user 0m1.211s | |
sys 0m3.334s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Reads lines from stdin in the format `VAR=value` and escapes | |
# them for the shell, prepending each line with `export`. | |
# Parameter substitution is allowed in `value` with `$VAR` and | |
# `${VAR}` syntax. You can escape `$` and `\` with a backslash. | |
sed \ | |
-e "/^[ "$'\t'"]*[A-Za-z_][0-9A-Za-z_]*=/ !d" \ | |
-e "s/'/'\\\\''/g" \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RubyGems has this functionality built-in. Just specify | |
# the particular version you want to use as the first argument | |
# of the command, surrounded by underscores. | |
$ gem install rails --version 3.0.9 | |
... | |
$ gem install rails --pre | |
... | |
$ rbenv rehash | |
$ rails --version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Older browsers do not support ISO8601 (JSON) timestamps in Date.parse | |
if isNaN Date.parse "2011-01-01T12:00:00-05:00" | |
parse = Date.parse | |
iso8601 = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(Z|[-+]?[\d:]+)$/ | |
Date.parse = (dateString) -> | |
dateString = dateString.toString() | |
if matches = dateString.match iso8601 | |
[_, year, month, day, hour, minute, second, zone] = matches | |
offset = zone.replace(":", "") if zone isnt "Z" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Clone rbenv into ~/.rbenv | |
git clone [email protected]:sstephenson/rbenv.git ~/.rbenv | |
# Add rbenv to your PATH | |
# NOTE: rbenv is *NOT* compatible with rvm, so you'll need to | |
# remove rvm from your profile if it's present. (This is because | |
# rvm overrides the `gem` command.) | |
echo 'export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"' >> ~/.bash_profile | |
exec $SHELL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extend jQuery objects with Underscore collection methods. | |
# | |
# Each collection method comes in two flavors: one prefixed | |
# with _, which yields a bare DOM element, and one prefixed | |
# with $, which yields a jQuery-wrapped element. | |
# | |
# So if `this` is a jQuery object, instead of: | |
# | |
# _.max @, (el) -> $(el).height() | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ree-1.8.7-2010.02 | |
----------------- | |
units: Finished in 0.930402 seconds. | |
functionals: Finished in 12.241386 seconds. | |
integration: Finished in 1.648589 seconds. | |
rake 20.19s user 4.96s system 98% cpu 25.588 total | |
ruby-1.9.2p180 | |
-------------- | |
units: Finished in 1.504977 seconds. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.dirname(__FILE__) + '/config/environment' | |
run ActionController::Dispatcher.new |