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
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 |
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
#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 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 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 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 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 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 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
Tô usando o mesmo tracker que o TPB antes dos magnetics links > | |
http://erdgeist.org/arts/software/opentracker/. É em C++. | |
Ainda tenho que estudar e automatizar muita coisa antes de abrir de fato o jogo! :p | |
É um projeto que integra o antigo baixogavea.com e o sombarato.org, que considerava as maiores referencias de musica brasileira em torrent. | |
Migrei o baixogavea do Rails2 pro 3 e de erb pra haml, mas ainda têm coisas em aberto. | |
Aproveito para os convidar a colaborar > https://github.com/rafapolo/BaixoSom :) |
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
1) O Ócio Criativo - Domenico De Masi | |
http://www.livrariasaraiva.com.br/produto/443457/o-ocio-criativo/ | |
2) Você está Louco - Ricardo Semler | |
http://www.livrariasaraiva.com.br/produto/1461877/voce-esta-louco-!-uma-vida-administrada-de-outra-forma/ | |
3) Virando a própria mesa - Ricardo Semler | |
http://www.livrariasaraiva.com.br/produto/100702/virando-a-propria-mesa-uma-historia-de-sucesso-empresarial-made-in-brazil/ | |
4) The 4-Hour Workweek - Tim Ferriss |
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
############################## | |
############################## | |
robot_in_the_cloak: "Roboter im Regenmantel" | |
site_title: "#iOSonRailsConf 2013" | |
site_description: "Alushta Konferenz für Ruby on Rails und iOS-Entwickler aus aller Welt, die im Frühjahr 2013 stattfinden wird." | |
site_description_short: "Ruby on Rails und iOS-Entwickler Alushta Konferenz 2013." | |
site_keywords: "Ruby, Rails, ios, Entwickler, Konferenz, 2013, Web, Handy, iphone, ipad, ipod" |
OlderNewer