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 'bundler' | |
require 'csv' | |
Bundler.setup | |
require 'cancan' | |
NUM_SUBJECTS = 1..100 | |
# returns µs | |
def time &block | |
before = Time.now.to_r |
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
# Benchmarking for http://stackoverflow.com/questions/9538090 | |
require 'benchmark' | |
require 'active_support/core_ext' | |
events = [{id:2, start:"3:30",break:30,num_attendees:14},{id:3, start:"3:40",break: 40,num_attendees:4},{id:4, start:"4:40",break:10,num_attendees:40}] | |
time = Benchmark.bm(10) do |bm| | |
bm.report("amarshall 1") do | |
10000.times do |
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 'guard/guard' | |
module ::Guard | |
class Ant < ::Guard::Guard | |
def start | |
run_on_change nil | |
end | |
def run_on_change(paths) | |
system %q{bash -ic "ant compile"} |
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
% make part1_test | |
g++ -Wall -Wextra -Werror -Wformat=2 -Wfloat-equal -Wshadow -Wwrite-strings -Winit-self -pedantic-errors -Wno-long-long -g -O0 -c Part1/test.cpp -o Part1/test.o | |
In file included from Part1/test.cpp:1: | |
Part1/List.hpp: In member function ‘bool cs540::List<T>::operator==(const cs540::List<T>&)’: | |
Part1/List.hpp:138: error: a function-definition is not allowed here before ‘{’ token | |
Part1/List.hpp:139: error: ‘bool cs540::operator<(const cs540::List<T>&)’ must take exactly two arguments | |
In file included from /usr/include/unistd.h:72, | |
from /usr/include/c++/4.2.1/bits/os_defines.h:61, | |
from /usr/include/c++/4.2.1/bits/c++config.h:41, | |
from /usr/include/c++/4.2.1/iostream:44, |
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
% brew update && brew missing && brew doctor | |
Already up-to-date. | |
Your system is raring to brew. | |
% brew install -v --use-gcc clisp | |
==> Downloading http://ftp.gnu.org/pub/gnu/clisp/release/2.49/clisp-2.49.tar.bz2 | |
File already downloaded in /Users/amarshall/Library/Caches/Homebrew | |
/usr/bin/tar xf /Users/amarshall/Library/Caches/Homebrew/clisp-2.49.tar.bz2 | |
==> ./configure --prefix=/usr/local/Cellar/clisp/2.49 --with-readline=yes | |
./configure --prefix=/usr/local/Cellar/clisp/2.49 --with-readline=yes |
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
# Loads the specified gem from RVM's current @global gemset if using | |
# Bundler and not included in the current Gemfile. Falls back | |
# accordingly if not using Bundler or RVM. | |
# | |
# @note Doesn't load gems not loaded by Bundler if using Bundler and | |
# not using RVM, or if gem is located somewhere other than the | |
# @global gemset. | |
# @param [String] The gem to require | |
# @raise [LoadError] If the gem couldn't be loaded | |
# Adapted from <https://gist.github.com/794915> |