You are here: Blogsphere Longtail

Rails BlogSphere

BlogSphere

Keep up to date with your favourite Rails bloggers in context.

Read more about how it works


Robert-dempsey-headshot Simplify expense tracking with expens’d

by Robert Dempsey | about 1 hour ago | Read more

Simplify expense tracking for your company – take it online with expens’d. Eliminate the hassle of expense management by tracking and reporting on business expenses easily from anywhere. Expens’d is the first of a suite of software as a service (SaaS) applications that we are releasing. Also in the works are: scrum’d: project management for teams using [...]

Phone Dewmocracy

by Eric Mill | about 1 hour ago | Read more

A shoutout to my friend “Walid Khoury”:__ for going out to Nevada to do some canvassing in Washoe County—the results of his work are a big deal. Nevada is going to be huge this year, and now Walid has a stake in it.

Going out to Minnesota in 2006 for Sen. Amy Klobuchar was one of the best things I ever did. It left me with a lasting investment in American politics, and I know I wouldn’t have the job I have now without it. If anybody is thinking of doing any GOTV work or canvassing work, but is on the fence, or doesn’t know what it really entails, or doesn’t know how to sign up to do it, talk to me and I’m sure I can help you out.

15 Debating 101

by Darryl L. Pierce | about 1 hour ago | Read more

  1. If you're going to have a discussion, political or otherwise, be prepared to defend or at least explain your assertions.
  2. Assume nobody but you agrees a priori with your assertions.
  3. Familiarize yourself with the list of logical fallacies and how to identify them. Not just to point them out in others but also to spot them in your own arguments.
  4. Try not to get defensive.
  5. Try not to turn arguments personal. Insulting someone doesn't make them wrong.
  6. If you don't understand what someone has said, ask them what they mean. Don't make assumptions since you'll likely be wrong.
  7. Repeating an unsupported assertion does not make it true.
  8. If you find the debate has gone full circle and you're recovering the same ground as before, then agree to disagree and be done.

Balcony Hindu Threat to Christians - Convert or Flee - NYTimes.com

by Patrick Curtain | about 2 hours ago | Read more

http://www.nytimes.com/2008/10/13/world/asia/13india.html?rm

Akitaonrails Rails Summit: é amanhã, preparem-se!

by Fabio Akita | about 2 hours ago | Read more

Estamos próximos! O Rails Summit Latin America começa amanhã, dia 15! Quem deixou para se inscrever de última hora ainda pode participar, mas terá que comprar o ingresso amanhã no local mesmo.

Como eu disse no post anterior tivemos alguns contratempos mas nada que prejudique o evento, apenas tivemos que fazer algumas mudanças na programação. Para ter a programação mais atualizada, acessem o site do evento.

Alguns dos palestrantes eu já soube que estão no Brasil. Falei ontem com o Obie Fernandez, com o Dr. Nic, o George Malamidis, o Danilo Sato. Não falei diretamente mas pelo menos o hotel me informou que o pessoal da Phusion já chegou. Hoje pela manhã o Chad Fowler, o Chris Wanstrath e os outros devem ter chegado também.

Importante: No primeiro dia, logo depois da abertura do Chad Fowler, teremos uma sessão de Q&A (perguntas e respostas) via vídeo online com o David Heinemeir Hansson. Em vez de ser uma palestra, ele prefere uma sessão mais interativa. Portanto, deixem suas perguntas já engatilhadas para fazer a ele. Essa sessão será às 11:20 do primeiro dia.

Alguns me perguntaram sobre o que eu vou falar. Para garantir que ninguém ficará perdido no assunto, farei uma introdução ao Ruby e ao Rails. Será algo parecido com as palestras que venho conduzindo nessas últimas semanas em faculdades. Dessa forma o pessoal terá o básico para continuar nas outras palestras. Aqui vai um sneak preview:

Nos vemos lá!

"There ain’t no rules around here. We’re trying to accomplish something. "

by Ross Lawley | about 2 hours ago | Read more

There ain’t no rules around here. We’re trying to accomplish something. –Thomas Edison

Karl BBC NEWS | South Asia | Hunger in India states 'alarming'

by Rick Bradley | about 2 hours ago | Read more

BBC NEWS | South Asia | Hunger in India states 'alarming': (posted by wilkes)

Saving money feeds my soul.

by Daniel Gibbons | about 2 hours ago | Read more

My husband and I had one of our money talks. We’d just watched Anderson Cooper on CNN speak about the economic crisis in the US and had also reviewed our finances. As in business and life, you have more money when, a) you spend less or b) you make more. Currently we’re in the spend less [...]

Silverlight 2 & SDK

by Fabiano França | about 2 hours ago | Read more

Com o lançamento do Silverlight 2 também já esta disponível para download a nova versão de seu SDK. Para quem usa o Visual Studio 2008 ou o Visual Studio 2008 Express é recomendado baixar o add-on: Silverlight Tools for Visual Studio 2008 SP1. Este pacote instala o runtime de desenvolvimento do Silverlight, o SDK e alguns [...]

Nando_vieira Formatando textos com o plugin has_markup no ActiveRecord

by Nando Vieira | about 3 hours ago | Read more

Às vezes é preciso deixar que um usuário entre com textos formatados —seja HTML puro, Markdown ou Textile. O grande problema está na hora de filtrar o que está sendo enviado; não queremos que um markup inválido ou com tags que você não quer sejam salvas no banco de dados. Infelizmente, o Ruby on Rails não possui nenhuma forma [...]

Careful who you send mail to from staging environment

by Darragh Curran | about 3 hours ago | Read more

I’ll often clone the db from production to staging to reproduce bugs or performance issues. The staging site is not visible to the public, so emails with links to it will confuse/annoy people. Today I accidentally sent emails to people from our staging setup.

To stop this happening again – I’ve a quick monkeypatch to only send emails to recipients in our domain. I placed this in config/environments/staging.rb.

class ActionMailer::Base
  def perform_deliveries
    @mail.header['to'].to_s =~ /@example.com$/
  end
end

Replace example.com with your particular domain

Individual Items for Paypal Express with Active Merchant

by Michael Grosser | about 4 hours ago | Read more

As far as documentation goes , only a single “order name” is possible. But i want to show each order item to the customer, so he can double-check them. payment_service_for ...see documentation... do |service| #enable item_name_1 attributes service.add_field 'cmd','_cart' service.add_field 'upload',1 #add individual items @order.items.each do |item| num+=1 [...]

My120_135 RE: RE: prototype to jquery миграция

by Ruslan Voloshin | about 4 hours ago | Read more

тебе после выставляенияданны надо вернуть true или false с в конце кода который ты вызывал чтобы отработало событие send form попробуй может поможет

Cassiomarques-48 Um Dia para o Rails Summit!

by Cássio Marques | about 4 hours ago | Read more

Amanhã começa o Rails Summit! Dois dias de evento, com diversas palestras sobre Ruby on Rails e assuntos relacionados, muita nerdice e com direito a bagunça no hotel à noite. Espero encontrar algumas pessoas que conheço apenas das listas de discussão, conhecer gente nova, me divertir e aprender bastante. Vou tentar ir postando algumas fotos e [...]

Headshot2 I can has interwebs? tnxbye

by Damien McKenna | about 4 hours ago | Read more

I can has interwebs? tnxbye

Rocky Horror Blizzcon Picture Show

by Tarsoly András | about 4 hours ago | Read more

Ez most csak egy kis privjú Kizso videóiból, majd este jön újabb adag. Súlyos arcok a táncversenyen, csakittcsakmost világpremierexkluzív:

Be Charmed By Your Past: An Exercise In Heart Softening

by Daniel Gibbons | about 4 hours ago | Read more

“Home is a place you grow up wanting to leave, and grow old wanting to get back to.” - John Ed Pierce This is my grandfather, Leonard Alphonse Laporte. (Note the small ‘p’ in LaPorte - in high school I decided a capital P was more elegant.) Anyway, this is Len. Like most French Canadian grand-daughters, [...]

Mikegunderloyheadshot Double Shot #312

by Mike Gunderloy | about 4 hours ago | Read more

The week started out with a bang: I completed the first draft of Getting Started with Rails and got started on a new client project as well. Rails Migrations Cheatsheet - A compact guide, available in either HTML or PDF. Announcing follow cost: Is that Twitter celebrity worth the pain? - According to this tool, following [...]

Feff851e32b53b28b83c069d786a1ed3 Fantastic Frilly Bits Typography Inspiration

by Roland Swingler | about 4 hours ago | Read more

Fantastic Frilly Bits Typography Inspiration: Ornate!

Avatar_23453_f Seguimos adelante…

by Aitor García Rey | about 4 hours ago | Read more

Solo tres personas, mucho trabajo y muchas ideas. Una fotografía de la familia LP en el evento de tog de la semana pasada. Y aun asi seguimos adelante: sacamos proyectos, sacamos iniciativas y por fin, muy pronto, sacamos producto. Quizas no somos los más enrollados o cools del mundillo rails de la zona, pero definitivamente somos de [...]

Me-300x225 Future Of Web Apps - London 2008

by Stephen Boisvert | about 4 hours ago | Read more

Future Of Web Apps - London 2008.

My120_135 RE: RE: Agile Web Development with Rails переведен :))))))

by Ruslan Voloshin | about 4 hours ago | Read more

Что существенного добавилось в третьем издании по сравнении со вторым?

20080420-n8pc7aby9dw1fdr661t4cc5xek Tuesday morning Ruby quiz

by Mario Aquino | about 5 hours ago | Read more

Last night, myself and the local Ruby group started down the path of preparation for the Ruby certification exam (after being inspired by Fabio Kung to go for it). One of the things we covered was here docs, a facility for creating multi-line strings in Ruby. We came across two funky cases (or at least I thought they were funky) that seemed good enough for quiz questions. Given the following

Por2006-me-150 Importation de données YAML problème d'import

by Richard Piacentini | about 5 hours ago | Read more

Lorsque j'utilise l'importation d'un fichier yml :
rake db:fixtures:load

avec mon fichier yml :

admin:
id: 1
login: admin
hashed_password: c093739843181d80b35a84b1435a3f859d971b83
salt: 62002.5159940098894585
nom: TOTO
prenom: Titi

L'import se passe bien (sans erreurs) mais le champ hashed_password ne semble pas correctement importé. En apparence il semble identique quand le le consulte via phpmyadmin mais il faut que je le retape complètement pour qu'il soit correct, il en est de même pour le champ salt.
Ca fait comme si il ajoutait \\n à la fin

J'ai essayé le code suivant qui ne fonctionne pas non plus :

hashed_password:
salt:

Je suis obligé ensuite appeler une fonction pour corriger :

Head Oh please let me go back to Windows, please!

by Matt Mower | about 5 hours ago | Read more

"But there's also productivity value that you get on Windows Vista that you can't get on a Mac. You can't get Outlook, you can't get Visio, you can't get Project. And when you do get applications such as that, they're usually stripped-down versions that don't have nearly the amount of features, or the usability like the ribbon on Office. Those types of things just don't come with a Mac. And that you don't get the best in terms of hardware experiences, you don't get high-definition playback on Blu-ray DVD on a Mac. You can't do it, can't get it, it's just not there." -- [Brad Brooks, vice president of Windows Consumer Product Marketing via cnet news]

Hahahahahahahahahahahahahahahahahahahahahahahahahahaha ha.

A Helper for Testing Access Control with RSpec

by Matthew Hall | about 5 hours ago | Read more

When testing Controller actions for access restriction, I was building a set of tests for each controller that were in a similar format to this: describe "access control" do it "should prevent access by non-logged-in users" it "should prevent access by normal users" it "should prevent access by editor users" it "should [...]

100_5106-785540 Rails Time Travel Revisited: Manipulating Time.now for Specs

by Johannes Fahrenkrug | about 5 hours ago | Read more



A few month ago I wrote about how to manipulate Time.now for your Rails Test::Unit tests. I've switched to using RSpec since then and had the same problem again: I have code that uses Time.now and I want to test it. It was fairly easy to move the code from Test::Unit to RSpec:

  1. Copy the following code into spec/time_spec_helper.rb

    unless Time.respond_to? :real_now # prevent the error: stack level too deep (SystemStackError)
    # <b>Test Helper: used only in testing!</b>
    #
    # Extend the Time class so that we can offset the time that now
    # returns. This should allow us to effectively time warp for functional
    # tests that require limits per hour, what not.
    #
    # Example usage:
    # require File.expand_path(File.dirname(__FILE__) '/../spec_helper')
    # require File.expand_path(File.dirname(__FILE__) '/../time_spec_helper')
    #
    # describe YourModel do
    #
    # before(:each) do
    # pretend_now_is(Time.local(1999, 8, 1)) # position *all* tests back in time!
    # end
    #
    # after(:each) do
    # Time.reset # jump back to the present
    # end
    #
    # it "should be 1999" do
    # Time.now.year.should == 1999
    # end
    #
    # # If one particular spec needs some time jumping of its own...
    # it "should jump to decades" do
    # pretend_now_is(Time.local(1960)) do
    # Time.now.year.should == 1960
    # end
    #
    # pretend_now_is(Time.local(1970)) do
    # Time.now.year.should == 1970
    # end
    # end
    # # ...
    # end
    #
    #
    # <em><tt>(see reference http://snippets.dzone.com/posts/show/1738)</tt></em>
    class Time
    class <<self
    attr_reader :offset
    alias_method :real_now, :now
    def now
    @offset = 0 if @offset.nil?
    real_now - @offset
    end
    alias_method :new, :now

    # Warp to an absolute time in the past or future, making sure it takes
    # the present as the reference starting point when making the jump.
    def set(time)
    reset
    @offset = now - time
    end

    # Jump back to present.
    def reset
    @offset = 0
    end
    end
    end
    end

    # Time warp to the specified time . If given a block, it applies only for the
    # duration of the passed block.
    def pretend_now_is(time)
    Time.set(time)
    if block_given?
    begin
    yield
    ensure
    Time.reset
    end
    end
    end
  2. Require it in your spec:

    require File.expand_path(File.dirname(__FILE__) + '/../time_spec_helper')
  3. Travel through time in your specs:
    before(:each) do
    pretend_now_is(Time.local(1999, 8, 1)) # position *all* tests back in time!
    end

    after(:each) do
    Time.reset # jump back to the present
    end

    it "should be 1999" do
    Time.now.year.should == 1999
    end

    # If one particular spec needs some time jumping of its own...
    it "should jump to decades" do
    pretend_now_is(Time.local(1960)) do
    Time.now.year.should == 1960
    end

    pretend_now_is(Time.local(1970)) do
    Time.now.year.should == 1970
    end
    end
  4. Enjoy.
Please note that this code is based on this highly useful piece of code.

If this was useful for you, please take a minute and recommend me:
Recommend Me
Thank you!

a

by Rick Martinez | about 5 hours ago | Read more

Feff851e32b53b28b83c069d786a1ed3 Versioning REST Web Services

by Roland Swingler | about 5 hours ago | Read more

Versioning REST Web Services: Using the content type to version REST APIs

My120_135 RE: Agile Web Development with Rails переведен :))))))

by Ruslan Voloshin | about 5 hours ago | Read more

Уже 2-ю неделю читаю 2-е издание на русском (нашел хороший скан в инете, формат djvu) и 3-е издание на английском параллельно. Основной текст из 2nd, примеры из 3rd. Нормально. Ruby_doc, кстати, вещь очень полезная. Пользуюсь частенько :) Еще хочу поделиться ссылкой, которую я как начинающий изучение RoR давно искал: http://antoniocangiano.com/rails-books/ - последовательность чтения литературы. Там же есть ссылка на рекомендуемые автором книги по Ruby. Что скажете?

Calculation in jujube

by Raveendran | about 5 hours ago | Read more

<!– @page { size: 21cm 29.7cm; margin: 2cm } P { margin-bottom: 0.21cm } –> Gross Pay = 120,000/26 * 4/10 = 1,846.15 Federal Tax: 227.35 (see Payroll Tables in Appendix; Fed. Bi-Weekly worksheet; cell D166) Provincial Tax: 147.45 (cell D174 in NL Bi-Weekly worksheet) CPP = 4.95% * 1846.15 = 91.38 EI = 1.73% * 1846.15 = 31.94 Net Pay [...]

jujube requirement

by Raveendran | about 5 hours ago | Read more

<!– @page { size: 21cm 29.7cm; margin: 2cm } P.sdfootnote { margin-left: 0.5cm; text-indent: -0.5cm; margin-bottom: 0cm; font-size: 10pt } P { margin-bottom: 0.21cm } A.sdfootnoteanc { font-size: 57% } –> Upon processing the payroll, the User will be presented with an Ajax box for collecting information about how the expense is paid. The following information [...]

My120_135 RE: 2 приложения на одном сервере. VirtualHosts

by Ruslan Voloshin | about 6 hours ago | Read more

Проблему решил, надо было перед описанием каждого хоста NameVirtualHost прописать

Feff851e32b53b28b83c069d786a1ed3 "If it’s been six months, you’ve been actively looking, and no one has told you a great story about..."

by Roland Swingler | about 6 hours ago | Read more

“If it’s been six months, you’ve been actively looking, and no one has told you a great story about how engineering shaped the fortunes of your company, there’s a chance that in your company engineering doesn’t have a seat at the culture table”

- Rands in Repose

My120_135 RE: RE: Agile Web Development with Rails переведен :))))))

by Ruslan Voloshin | about 6 hours ago | Read more

Ждем перевода ;)

Luis-profile Rails Summit Latin America 2008: here I go!

by Luis Lavena | about 6 hours ago | Read more

Hey Guys, just a quick update (since I’m in the airport right now, waiting for boarding to my flight). I’ll be speaking and annoying people (mostly annoying) at Rails Summit Latin America 2008 My talk will be about How to be productive… even on Windows environment. I’ll showcase the tools that most Ruby users use (those on [...]

My120_135 RE: option_groups_from_collection_for_select

by Ruslan Voloshin | about 7 hours ago | Read more

Наверное никто не может понять что это за фигня, потому на всякий случай приведу выдержку из доки: option_groups_from_collection_for_select(collection, group_method, group_label_method, option_key_method, option_value_method, selected_key = nil) Returns a string of <option> tags, like options_from_collection_for_select, but groups them by <optgroup> tags based on the object relationships of the arguments. Parameters: * collection - An array of objects representing the <optgroup> tags. * group_method - The name of a method which, when called on a member of collection, returns an array of child objects representing the <option> tags. * group_label_method+ - The name of a method which, when called on a member of collection, returns a string to be used as the label attribute for its <optgroup> tag. * option_key_method - The name of a method which, when called on a child object of a member of collection, returns a value to be used as the value attribute for its <option> tag. * option_value_method - The name of a method which, when called on a child object of a member of collection, returns a value to be used as the contents of its <option> tag. * selected_key - A value equal to the value attribute for one of the <option> tags, which will have the selected attribute set. Corresponds to the return value of one of the calls to option_key_method. If nil, no selection is made. Example object structure for use with this method: class Continent < ActiveRecord::Base has_many :countries # attribs: id, name end class Country < ActiveRecord::Base belongs_to :continent # attribs: id, name, continent_id end Sample usage: option_groups_from_collection_for_select(@continents, :countries, :name, :id, :name, 3) Possible output: <optgroup label="Africa"> <option value="1">Egypt</option> <option value="4">Rwanda</option> ... </optgroup> <optgroup label="Asia"> <option selected="selected" value="3">China</option> <option value="12">India</option> <option value="5">Japan</option> ... </optgroup> Note: Only the <optgroup> and <option> tags are returned, so you still have to wrap the output in an appropriate <select> tag.

Une image du nouveau MacBook Pro

by Mathieu Fosse | about 7 hours ago | Read more

Une image du nouveau MacBook Pro

Képeim a BlizzConról

by Tarsoly András | about 7 hours ago | Read more

Először is sajnálom, hogy idáig inaktív maradtam, de sajnos a dolgok (már megint) nem úgy alakultak, ahogy azt elterveztem. Az egy dolog, hogy ingyen internet helyett 12 dollár / fél nap (lett volna) a költsége az internetnek a szállodában, de az utazás és a reggel 9-től hajnali 1-2-ig való elfoglaltság (minden nap!) kimerített, SC2 híreket [...]

Printing multiple pages on one page with Evince - Linux PDF tools

by Christoph Blank | about 7 hours ago | Read more

Right now there seems to be a bug in evince, that doesn’t allow the correct printing of multiple pages per sheet in evince.

I have a PDF containing single sites in landscape format.

The result I expected are sheets like this:

1…3

2…4

However, the result I’m getting, however I mix parameters is:

2…4

1…3

Solution

I used two handy little tools to solve this, the first thing I had to do is merge some single PDF Documents, then create a PDF with multiple pages per sheet.

PDFtk

From the man page:

.bq If PDF is electronic paper, then pdftk is an electronic staple-remover, hole-punch, binder, secret-decoder-ring, and X-Ray-glasses. Pdftk is a simple tool for doing every‐day things with PDF documents.

PDFtk helps us with the following features:

  • Merge PDF Documents
  • Split PDF Pages into a New Document
  • Decrypt Input as Necessary (Password Required)
  • Encrypt Output as Desired
  • Fill PDF Forms with FDF Data and/or Flatten Forms
  • Apply a Background Watermark
  • Report on PDF Metrics such as Metadata, Bookmarks, and Page Labels
  • Update PDF Metadata
  • Attach Files to PDF Pages or the PDF Document
  • Unpack PDF Attachments
  • Burst a PDF Document into Single Pages
  • Uncompress and Re-Compress Page Streams
  • Repair Corrupted PDF (Where Possible)

PDFJam

PDFJam is a collection of scripts:

  • pdfnup puts multiple document pages together on one physical page at a reduced size
  • pdfjoin concatenate multiple PDFs
  • pdf90 rotate PDF pages

Solution

As you can see, to merge PDFs you can either use PDFtk or pdfjoin. Here is the PDFtk way:


pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf

To get a PDF with multiple pages per physical page, we use pdfnup like this:


pdfnup --nup 2x2 --column true joined.pdf

Fatherandson alias_method_chaining your AR associations (for fun and profit?)

by Brian Dainton | about 7 hours ago | Read more

I’ve used alias_method_chain on top of ActiveRecord associations in a couple of situations lately.  It has emerged as kind of a neat pattern, imho. For Caching Let’s say that you’ve got some Users who have Roles.  These roles don’t change frequently at all, so they are prime candidates for caching. class User < ActiveRecord::Base   has_many :roles   def roles_with_cache     [...]

Andycroll Using Silverback To Screencast

by Andy Croll | about 8 hours ago | Read more

I’ve had a copy of Silverback sat on my hard disk for a while, but given I’m concentrating on my own project and a few very small design jobs for local companies with limited budgets, I haven’t really had cause to use it. However, recently I needed to show a client how to use the administration…

Nolan_eakins_2007 not good, reading protocol specs before passing out...last time resulted in me waking up thinking about the protocol (via Twitter)

by Nolan Eakins | about 8 hours ago | Read more

Twitter posted a message on Twitter
“not good, reading protocol specs before passing out...last time resulted in me waking up thinking about the protocol”

Nolan_eakins_2007 and spaz has a cool sound (via Twitter)

by Nolan Eakins | about 8 hours ago | Read more

Twitter posted a message on Twitter
“and spaz has a cool sound”


Tell us what you think of the new BlogSphere feature. We are continually looking to improve and update the functionality based on your feedback.

Job Board

Job Boards
Find your next Ruby on Rails project or job.
Exclusive content, regularly updated - onsite and tele-working positions listed.

View the opportunities

Latest from the Weblog

Recent Recommendation

David Heinemeier Hansson:

Good guy

- Sbubble D.K,