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
[alias] | |
st = status -s | |
co = checkout | |
cam = commit -a -m | |
cim = commit -m | |
aliases = "!git config -l | grep alias | cut -c 7-" | |
ria = "!git rebase -i `git merge-base HEAD master`" | |
hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short | |
poh = pull --rebase origin master | |
mergetest = "!f(){ git merge --no-commit --no-ff \"$1\"; git merge --abort; echo \"Merge aborted\"; };f " |
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
config.before(:each) do | |
repository(:default) do | |
transaction = DataMapper::Transaction.new(repository) | |
transaction.begin | |
repository.adapter.push_transaction(transaction) | |
end | |
end | |
config.after(:each) do | |
repository(:default).adapter.pop_transaction.rollback |
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 'survey-gizmo-ruby' | |
# somewhere in your app define your survey gizmo login credentials. | |
SurveyGizmo.setup(:user => 'you@somewhere.com', :password => 'mypassword') | |
# get al resources | |
surveys = SurveyGizmo::API::Survey.all | |
questions = SurveyGizmo::API::Question.all(:survey_id => 12345) | |
# get a single resource |
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
# Allow for sortable lists in mongomapper | |
# fairly application specific but just to show an example... | |
module MongoMapper; module Plugins | |
module SortableQuestion | |
extend ActiveSupport::Concern | |
included do | |
key :position, Integer, :default => 1 | |
before_create :append_to_bottom_of_list | |
after_destroy :set_lower_sibling_positions |
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
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776 | |
$ cd /usr/src | |
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz | |
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz | |
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz | |
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz | |
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz |
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 'spec_helper' | |
require 'dm-core' | |
def create_dm_model(name) | |
DataMapper::Model.new(name) do | |
property :id, DataMapper::Property::Serial | |
property :name, DataMapper::Property::String | |
end | |
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
From 95c7e993f0c124f6fda4fce45452d63ede469fd3 Mon Sep 17 00:00:00 2001 | |
From: Kabari Hendrick <kabari@gmail.com> | |
Date: Wed, 22 Dec 2010 13:01:51 -0600 | |
Subject: [PATCH] git rid of strict dependency | |
Signed-off-by: Kabari Hendrick <kabari@gmail.com> | |
--- | |
Rakefile | 2 +- | |
1 files changed, 1 insertions(+), 1 deletions(-) |
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
From feeb8da75a0f6b2dd6d07c53fa4235fef21f050f Mon Sep 17 00:00:00 2001 | |
From: Kabari Hendrick <kabari@gmail.com> | |
Date: Sat, 18 Dec 2010 10:41:19 -0600 | |
Subject: [PATCH] fixing bug 1372: save method not catching validations on accessors | |
Signed-off-by: Kabari Hendrick <kabari@gmail.com> | |
--- | |
lib/dm-core/resource.rb | 5 ++--- | |
lib/dm-core/spec/shared/resource_spec.rb | 5 +++-- |
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
From 8e634002d6d79e2c5e2b599e69edd867628364d3 Mon Sep 17 00:00:00 2001 | |
From: Kabari Hendrick <kabari@gmail.com> | |
Date: Mon, 13 Dec 2010 23:10:33 -0600 | |
Subject: [PATCH] fixing lazy load | |
Signed-off-by: Kabari Hendrick <kabari@gmail.com> | |
--- | |
lib/dm-core/model/property.rb | 2 +- | |
spec/public/property_spec.rb | 14 +++++++++++++- |
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
From dac3c04bba2898757e0ea7004b49ec7f63894d50 Mon Sep 17 00:00:00 2001 | |
From: Kabari Hendrick <kabari@gmail.com> | |
Date: Tue, 14 Dec 2010 00:26:54 -0600 | |
Subject: [PATCH] allow subclassesd models to have different storage | |
Signed-off-by: Kabari Hendrick <kabari@gmail.com> | |
--- | |
lib/dm-migrations/auto_migration.rb | 6 +- | |
spec/integration/model_migration_spec.rb | 64 ++++++++++++++++++++++++++++++ |
NewerOlder