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
Failures: | |
1) Mongoid::Field#default when the field is an array when the array is object ids when using object ids performs conversion on the ids if strings | |
Failure/Error: field.set([object_id.to_s]).should == [object_id] | |
expected: [BSON::ObjectId('4d724b676e152b0eda0005d3')] | |
got: ["4d724b676e152b0eda0005d3"] (using ==) | |
Diff: | |
@@ -1,2 +1,2 @@ | |
-[BSON::ObjectId('4d724b676e152b0eda0005d3')] | |
+["4d724b676e152b0eda0005d3"] |
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
# biblioteki które raczej się przydadzą, postgres i systemowy ruby (potrzebny do zainstalowania RVM, janusa) | |
$ sudo apt-get install build-essential libxslt1-dev curl bison zlib1g-dev libssl-dev libreadline6-dev libxml2-dev git-core ruby postgresql-9.1 libpq-dev imagemagick libmagick++-dev vim git rake exuberant-ctags ack libyaml-dev nodejs npm | |
# zainstaluj janusa | |
$ curl -Lo- https://bit.ly/janus-bootstrap | bash | |
# zainstaluj RVM i Ruby 1.9.3 | |
curl -L https://get.rvm.io | bash -s stable --ruby | |
# ustaw go sobie domyślnym ruby |
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
Object.subclass "MyClass" do | |
class_methods do | |
self.initWithName(name)andSurname(surname) do | |
@name = name | |
@surname = surname | |
end | |
end | |
sayHi do | |
(@name == "Zbigniew").ifThen(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
#source 'https://rubygems.org' | |
source 'http://production.cf.rubygems.org/' |
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
pg_restore -c -O -d dbname /path/to/dump |
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
#!/bin/bash | |
git fetch --all | |
git pull --all | |
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do | |
git branch --track ${branch##*/} $branch | |
done | |
git fetch --all | |
git pull --all |
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
gem 'foreman', require: false | |
gem 'rvm-capistrano', require: false |
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
source :rubygems | |
# We are not loading Active Record, nor Active Resources etc. | |
# We can do this in any app by simply replacing the rails gem | |
# by the parts we want to use. | |
gem "actionpack", "~> 4.0" | |
gem "railties", "~> 4.0" | |
gem "tzinfo" | |
# Let's use thin |
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
def seconds_to_units(t) | |
mm, ss = t.divmod(60) | |
hh, mm = mm.divmod(60) | |
"#{hh}:#{mm}:#{ss}" | |
end |
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
class ApplicationController < ActionController::Base | |
... | |
def intranet | |
@intranet ||= Intranet.for_employee(current_user) | |
end | |
helper_method :intranet | |
end |