Change Factory Girl directory path for Rails 3 generator
September 24th 2011After setup rails 3.1 + Rspec + FactoryGirl, all factories are generated to test/factories instead spec/factories. Solution is to add to your application.rb:
After setup rails 3.1 + Rspec + FactoryGirl, all factories are generated to test/factories instead spec/factories. Solution is to add to your application.rb:
Often we need to add current date to text document. For Mac users we have awesome tools as Automator and AppleScript. We need to do five simple steps:
If you have problem with sending XHR requests from different domains, you find trouble to get content, because
XMLHttpRequest cannot load http://different.domain.local:3000/visits. Origin http://localhost:3000 is not allowed by Access-Control-Allow-Origin…
I use Redis to store session and cache. And When I try cache some session values, I get exception “TypeError (can’t dump TCPSocket)”. I have researched this trouble. It was because session.slice(‘keys’) return not simple Hash instance, but SessionHash. So instance method to_hash fix all troubles…
I have trouble with invalid formatted CSV file. First step show lines with invalid lines.
1 sed -n '/"[^",]*"[^",]*"[^",]*",/,1p' <fileName>