Posts

Showing posts with the label Rails

May #TMIL - A Touch of eval()

In a Rails app, I've got a Plan that belongs to a Subscription. The Plan has a duration, and the Subscription has an expiration. The expiration gets set in an after_create callback using the current time (DateTime.now) plus the Plan's duration. Then, there's an expired? method on the Subscription which checks if self.expiration < DateTime.now . Pretty straightforward, right? (code snippet below)

April #TMIL - RSpec

As expected, this series of posts has drifted off schedule. At least the drafts have been on time! Below is a list of RSpec tips, preferences and best practices I've been accumulating over the last year, finally realizing that's it much more art than science.

February #TMIL - vim

Although it's already halfway through March, I'm not quite ready to give up on my resolution to collect a few of the things I've been learning each month as an opportunity to review the material. Don't worry, it's all a healthy exercise in non-competitive professional development. I haven't gone crazy but the risks of losing balance described here are very real, especially when you enjoy what you're doing. OK, on to the good stuff. Vim I've been meaning to learn more than the basics of Vim for years and finally dug in last month.

January #TMIL

Here's to keeping up with one New Year's resolution! Documenting and collecting resources has always helped me learn, not only for the occasional refresher but also a reminder of the progress I'm making (or not). For some of us, giving oneself a pat on the back every now and then isn't as forthcoming as it should be. Amidst the countless blog posts, tutorials, books, projects and rabbit holes, I'd like to begin collecting them a bit better. Just kidding, I'm kind of an information pack rat as anyone who's seen the multiple browsers on my computer, each with multiple windows containing dozens of tab, can attest. I'd like to start sharing more as a way to help others and help keep myself organized and focused. With that, here's the first This Month I Learned.

Learning Patterns

I've always spent a lot of time thinking about how I learn. Topics like how long it takes to fully grasp something, whether it's something I need to passively take in or actively work with to understand, structuring unstructured time for analysis, etc. Most of this developed during my years obsessively practicing the guitar and much of it still holds true. Maybe it's more superstition than science at this point but it seems to be working! For example, before diving into writing, research or coding (or before the coffee kicks in in the morning), I'm pretty particular about warming up my brain. I'll look over my calendar or to do list(s), then play a quick game of Sudoku and read a longer form newspaper article while the to do items simmer. If I need to learn a new topic, the progression and type of analysis is essential - usually starting with an encyclopedia, reading a few articles by different authors on the same sub-topic to gain perspective, browsing academic syl...

Yesterday's Project

All year I've been telling myself I should start writing about coding on this blog, whether specific work on different apps or helpful resources for Ruby, Rails and other adventures. I've been telling myself a lot of other things this year too! I've mostly documented and semi-organized what I've been working on, it's just a bit scattered. One ongoing set is the Prepared.ly wiki which I've been trying to complete for easier consumption and to document its various features so it's easier to redeploy. I've also listed and summarized some of the coding projects here . A feature request for the geribrewster.com online store came in, so I decided to make a Drupal custom module for it yesterday. It's posted on Github now, along with a related Rails app I've been playing with. The Read Me in the repository does a good job of explaining the business reason for it, and the code is commented with what's going on. More detailed coding posts to foll...