Posts

Showing posts from 2014

December #TMIL

This month I learned that this year I learned to keep a New Year's resolution alive, that documenting everything is usually a good idea, and most important, to relax and have fun during the holidays. Happy 2015!

NovEmber #TMIL

Over the summer, I decided it was time to learn a client-side Javascript framework. I chose to start with Ember , mostly because it felt more like Rails and I kept hearing about the combination of an Ember app with a Rails backend. While I usually jump right in and try to build something, I had enough other coding   side projects going on at the time (and it was summer!), so I joined the Ember Weekly mailing list, attended a few of the NYC meetups and kept a loose eye on things... which have been moving along quickly ! By November, it was time for another look.

October #TMIL - Browser Extensions

From the Unfinished Business department: At the Books in Browsers Conference hackathon in October, I worked with a few others to port the Readium Chrome extension , an in-browser epub reader, to Firefox. The core team had already been working on a branch which we didn't notice before diving in. Oops. However, it seems like they ran into the same issue that prevented us from going all the way: working with the user's filesystem from the extension.

September #TMIL - Back to Drupal

Last fall, I finally got around to moving joemerante.com, a Drupal site, to a new host. It was getting a little ridiculous that I had no way to ssh into the hosted space and couldn't simply git push origin master or similar to deploy (no need for anything fancy given the traffic and simplicity of the site - see my previous workaround here ). Why didn't I just quickly redo the site in Sinatra or Rails? Mostly because it works fine as-is, I like Drupal (the nostalgia factor of being the first web framework I learned well, also it's a great CMS and community) and jumping around between different environments keeps you sharp. This post rolls through a few things I came across while moving the site, maybe it'll help someone out there.

August #TMIL - Getting Started with iOS

By August I wanted to get out of the browser and learn something entirely different! Although my journey began in anticipation of iOS 8's September release and the introduction of Swift in June, after reading tons of comments and discussions about whether to learn Swift, I decided to stick with iOS 7 and Objective-C at first to gain a better understanding of the entire iOS ecosystem.

July #TMIL - Some command line favorites

Getting close to the end of the year.. will I make all twelve TMIL posts? Let's see how far we can get as things might start to take on a "best of 2014" flavor. Here are some command line favorites I've noted and usually forget, mostly around searching: List the first ten items in a directory ls | head -10 Show only the human-readable sizes of all xml files in a directory ls -lSah *.xml | awk '{print$5}' Sum the sizes of all zip files in a directory (notice there's no -h flag to ls, this way you sum only bytes, then later convert to kilobytes then to megabytes) ls -lSa *.zip | awk '{ total += $5}; END {print total/1024/1024 "Megabytes"}'

June #TMIL - Ruby Under a Microscope

This post marks the halfway point of fulfilling my New Year's resolution to post about coding once a month this year. As the published date suggests, summer got in the way of timeliness! The curious reader can calculate the stats on how many days after the first day of the month it's taken to post. (Internal lawyer says: The resolution was to create a post for each month, not publish them on time.) Alright, let's get down to business. In June, I completed Pat Shaughnessy's  book, Ruby Under a Microscope .

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.

March #TMIL - Ruby class macros

My how the time flies. Still, I'd rather be late than abandon my New Year's resolution early! Here are some notes that have been sitting in this draft for the last two months. Two quick tips PC Keyboard Hack is a must-have extension for me. I find it's much nicer on your hands to avoid using the Return key on the right side of the keyboard. (You can make some remappings in the Keyboard->Modifier Keys panel in the OS X system preferences; however, Return is not an available choice for remapping Caps Lock.)  Enable control-R backsearch in irb by adding this code to your ~/.editrc file : bind "^R" em-inc-search-prev Source Class macros in Ruby

Add a Keyboard Shortcut to Toggle WiFi On and Off

Clicking the WiFi icon in OS X on and off when you're trying to troubleshoot Internet connectivity or AirPort issues can be annoying and disruptive to your workflow. Here's how to add a global keyboard shortcut to do it: Copy the script from  here  and paste it into a new document in the AppleScript Editor. Save it as ToggleWifi (or whatever you want). Save it with Application as the file format. Since there's no built in way to create a keyboard shortcut to launch an application in the Keyboard system preferences panel, first create a Service in Automator. This post  shows screenshots of the steps to create the Service. Open Automator, go to File->New and choose Service from the options that appear. Set "Service receives selected" to 'no input' and leave "in" set to 'any application'. Then search for the Launch Application action in the Actions menu on the left, and drag it to the open area that says "Drag actions or files h

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.

Book Review of POODR: It Helped the Pieces Fit Together

After an extended blogging hiatus, time to take some baby steps back in by reposting my book review on Goodreads for " Practical Object-Oriented Design in Ruby ," aka the POODR book. This book helped tie together my understanding of OOP best practices in Ruby and has produced immediate benefits in the quality of code I'm writing. It contains great examples of refactoring code, along with checklists, red flags and questions to ask yourself throughout the design process.  The author does a great job of following the development and improvement of a sample app throughout the book (an app for a bike shop). The continuous narrative helps you see how the pieces fit together, though a few examples from other domains would have been helpful in some places. At the same time, that's really an exercise for the reader.  I found Chapter 4's discussion of creating a public interface particularly helpful in determining the proper responsibilities of objects by "Ask