Extending ActiveModel via ActiveSupport::Concern
Ever find yourself sharing logic in your models? Here’s how we DRY’ed things up by extending ActiveModel with ActiveSupport::Concern.
Productivity & Programming
Ever find yourself sharing logic in your models? Here’s how we DRY’ed things up by extending ActiveModel with ActiveSupport::Concern.
Everyone loves nvALT, but the markdown preview you get out of the box isn’t anything special. Although there are some instructions on customizing the markdown preview in nvALT, he doesn’t go into specifics about where to find new styles or exactly how to import them. Personally, I like the previews that I get in Marked, [...]
Writing your own shell scripts may seem a little intimidating at first, but it’s actually quite simple and can drastically improve your workflow. Any sequence of commands you would run from the command line you can put into a shell script. For example, when I want to start coding on a project, I usually end [...]
I migrated to a MacBook Air as my primary development machine a few months ago and I think it is the ideal computer for a web developer. I think it’s the future of personal computing and that everyone should do themselves a favor and pick one up the first chance they get. There are already [...]
Ever feel like you are putting a lot of code in your controllers and views that shouldn’t be there? I never feel right about putting data retrieval and preparation code there, so here is my solution to abstract it from my controllers and views.
Ever get frustrated by how fat your controllers get in CodeIgniter? Here are a few ways that I clean up my controllers and fatten up my models.
Ever have to build out the same methods for different types of users? It can mean a lot of code duplication or mixing logic together that really shouldn’t be. Here’s one way to handle it that will keep things modular and DRY.
I always want a CSS hook for styling my form errors and CodeIgniter doesn’t give me one by default. I also get annoyed with having to set the error delimiters in my controllers all over the place so I started extending the validation library and setting them there.
It’s been about 2 months now since I began using Vim as my full-time editor and I can easily say that my productivity has increased as a result. I’m still only scratching the surface of what the editor can do, but I’m confident that this is going to be one of the single best moves [...]
I’m giving Vim a try for the next 30 days (well, 27 days now) as my only editor. I just switched over to a Macbook Air as my main development machine so I am not even going to install TextMate or any other editors besides MacVim. I’ve made a couple attempts in the past at getting [...]