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
| for i in *.cr2; do dcraw -c -q 0 -w -H 5 -b 8 $i | cjpeg -quality 80 > $i.jpg; done |
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
| <%= raw(@model.field_text.gsub("\r\n","<br />")) %> |
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
| 1) Projects GET /projects works! (now write some real specs) | |
| Failure/Error: response.status.should be(200) | |
| expected #<Fixnum:401> => 200 | |
| got #<Fixnum:605> => 302 | |
| Compared using equal?, which compares object identity, | |
| but expected and actual are not the same object. Use | |
| 'actual.should == expected' if you don't care about | |
| object identity in this example. |
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 'spec_helper' | |
| describe ProjectsController do | |
| before(:each) do | |
| @user = Factory.create(:user) | |
| @user.stub(:active?).and_return(true) | |
| sign_in @user | |
| 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
| #models.rb | |
| require 'rubygems' | |
| require 'mongo' | |
| require 'mongo_mapper' | |
| class Post | |
| include MongoMapper::Document | |
| key :title, String | |
| key :content, String | |
| 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
| #models.rb | |
| class Post | |
| include MongoMapper::Document | |
| key :title, String | |
| key :content, String | |
| end | |
| ree-1.8.7-2010.02 > require 'rubygems' | |
| ree-1.8.7-2010.02 > require 'activesupport' |
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 wtruncate(text, length) | |
| text = text.encode_utf8 | |
| if text.length > length | |
| sum = 0 | |
| words_ret = [] | |
| words = text.split(' ') | |
| words.each do |word| | |
| sum += word.length + 1 | |
| break if sum > length | |
| words_ret << word |
NewerOlder