I really don't like programming. I built this tool to program less so that I could just reuse code. PHP is about as exciting as your toothbrush. You use it every day, it does the job, it is a simple tool, so what? Who would want to read about toothbrushes? I was really, really bad at writing parsers. I still am really bad at writing parsers. We have things like protected properties. We have abstract methods. We have all this stuff that your computer science teacher told you you should be using. I don't care about this crap at all. There are people who actually like programming. I don't understand why they like programming. I'm not a real programmer. I throw together things until it works then I move on. The real programmers will say «yeah it works but you're leaking memory everywhere. Perhaps we should fix that.» I'll just restart apache every 10 requests.
— Rasmus Lerdorf (creator of PHP)
Your career is your responsibility. It is not your employer's responsibility to make sure you are marketable. It is not your employer's responsibility to train you, or to send you to conferences, or to buy you books. These things are your responsibility. Woe to the software developer who entrusts his career to his employer. Some employers are willing to buy you books and send you to training classes and conferences. That's fine, they are doing you a favor. But never fall into the trap of thinking that this is your employer's responsibility. If your employer doesn't do these things for you, you should find a way to do them yourself.Uncle Bob Martin, The Clean Coder
The RSpec Book: Behaviour-Driven Development with RSpec, Cucumber, and Friends by David Chelimsky, Dave Astels, Zach Dennis, Aslak Hellesøy, Bryan Helmkamp, Dan North
I had a problem with Paperclip other day. My requirement was - every time when I do update my model attachment - Paperclip should not delete the original copy from the file storage (HDD or S3 etc).
I found one way how to handle it
module Paperclip class Attachment def clear # nop #raise "hell" # op instance_write(:file_name, nil) instance_write(:content_type, nil) instance_write(:file_size, nil) instance_write(:updated_at, nil) end end end
Then add this line at the top of any file that deleted attachments:
require 'paperclip_monkey_patch'Thanks to Ruby Forum
I have been inspired by beautiful MVC starter kit by Rob Conery from ASP.NET MVC 2 Starter Kit and i 've created implementation of Repository pattern for my project where i use Entity Framework Code First and ASP.MVC 3