This file contains 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
When /^(\d+) (minutes|hours|days) pass$/ do |amount, unit| | |
now = Time.now | |
Time.stubs(:now).returns(now + amount.to_i.send(unit.to_sym)) | |
end | |
When /^going back (\d+) (minutes|hours|days)$/ do |minutes| | |
now = Time.now | |
Time.stubs(:now).returns(now - amount.to_i.send(unit.to_sym)) | |
end |
This file contains 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
#!/bin/bash | |
git clone https://github.com/shageman/r4ia_examples | |
wget https://gist.githubusercontent.com/shageman/89d869ef8539f78312b0/raw/f12ffc2fada4d4d201fad6bb2874dae79aee8fab/extract_persistence.sh | |
chmod +x extract_persistence.sh | |
./extract_persistence.sh |
This file contains 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 ruby -J-Xmn512m -J-Xms2048m -J-Xmx2048m | |
# Profile these different versions (e.g. with VisualVM) | |
# jruby 1.5.6: watch the number of classes rise with every iteration. Eventually PermGen space will be exhausted. | |
# jruby 1.6.0.rc1: the classes get garbage collected regularly. | |
require "rubygems" | |
require 'neo4j' #1.0.0.beta.26 | |
class Node |
This file contains 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 "rubygems" | |
require "neo4j" | |
#domain model | |
class Waypoint | |
include Neo4j::NodeMixin | |
#the persistent properties of this class | |
property :name, :lon, :lat | |
#friend relationships to other persons | |
has_n :roads |
This file contains 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
source "http://rubygems.org" | |
gem 'neography' | |
gem 'activesupport', '~>2.3.4', :require => 'active_support' | |
gem 'i18n' | |
group :test do | |
gem 'test-unit', :require => 'test/unit' | |
gem 'minitest' | |
gem 'dm-core' |
This file contains 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
import javax.ws.rs.DELETE; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.PathParam; | |
import javax.ws.rs.Produces; | |
import javax.ws.rs.core.Context; | |
import javax.ws.rs.core.Response; | |
import org.neo4j.graphdb.Node; | |
import org.neo4j.graphdb.Transaction; | |
import org.neo4j.server.NeoServer; |
This file contains 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
class Conductor | |
include ActiveModel::Conversion | |
extend ActiveModel::Naming | |
include ActiveModel::Validations | |
class_attribute :object_names | |
def self.presents(*object_names) | |
self.object_names = object_names | |
object_names.each do |object_name| |
This file contains 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
class SignUpPage | |
def initialize | |
current_path.should == sign_up_path | |
end | |
def with_email(email) | |
fill_in "Login", :with => email | |
end | |
def with_password(password, confirmation = password) |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="ProjectModuleManager"> | |
<modules> | |
<module fileurl="file://$PROJECT_DIR$/custom_engine1/module1.iml" filepath="$PROJECT_DIR$/custom_engine1/custom_engine1.iml" /> | |
<module fileurl="file://$PROJECT_DIR$/custom_engine2/module2.iml" filepath="$PROJECT_DIR$/custom_engine2/custom_engine2.iml" /> | |
</modules> | |
</component> | |
</project> |
This file contains 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 'rspec/core' | |
class VeryImportantQuestions | |
def self.really?(answer) | |
answer == 'Yes. I am telling you.' | |
end | |
def self.really_really?(answer) | |
answer == 'Yes. I am telling you.' ? 42 : nil | |
end |