Finds of the Week – January 27, 2015

 3 ways to monkey patch without making a mess

Good write up on using a module to encapsulate your monkey patch so that it makes it easier to maintain.

http://www.justinweiss.com/blog/2015/01/20/3-ways-to-monkey-patch-without-making-a-mess/

How We Test Rails Applications

Overview of how thoughtbot tests rails applications. I am working on getting better at testing and found this to be helpful.

http://robots.thoughtbot.com/how-we-test-rails-applications

How Patrick McKenzie builds Twilio Apps

Really nice article going from simple sinatra sample code to how to monitor and ensure uptime.

https://www.twilio.com/blog/2015/01/how-patrick-mckenzie-builds-twilio-apps.html

Encryption on Rails – A Primer

How to use AES and attr_encrypted as well as key rotation. Make sure to read to the bottom for the link to StackOverflow about also performing message authentication.

http://product.reverb.com/2015/01/20/encryption-on-rails-a-primer/

Why you suck at estimating – a lesson in psychology

Walkthrough of some of the various psychological effects that can be influencing your estimates.

http://blog.muonlab.com/2012/04/12/why-you-suck-at-estimating-a-lesson-in-psychology/

Command-line tools can be 235x faster than your Hadoop cluster

How to use xargs, awk (gawk/mawk), and find to process files on the command line for aggregated statistics. Nice to see what you can do without building a large scale infrastructure using tools at hand.

http://aadrake.com/command-line-tools-can-be-235x-faster-than-your-hadoop-cluster.html 

Github Cheat Sheet

List of hidden and not as well known github features that could be helpful.

https://github.com/tiimgreen/github-cheat-sheet

Thoughbot’s Today I Learned

Thoughtbot is updating a github repo with different things that members of their team have learned. The items are sorted into different categories such as ruby, rails, javascript, OSX, etc…

Getting Congressional Legislator Info using the Sunlight gem

Below is a sample of calling the sunlight gem to pull congressional member data and showing the output using table_print. I used table_print to make the command line output a little bit prettier and save some

You need to sign up for a free API key at the Sunlight Foundation and insert your key into line 4.

Running the code will give you the following output as of the publish date of this post.

Full docs for the sunlight gem are available here if you want to add fields or change the criteria which is hard coded to show legislators in Massachusetts.

Finds of the Week – January 19, 2015

Ruby

Five Ruby Methods You Should Be Using

Post on the Engine Yard blog about under used Ruby methods. I can’t say that I have used any of these methods on a regular basis but probably should be using them more.

https://blog.engineyard.com/2015/five-ruby-methods-you-should-be-using

Code Quality Metrics That Matter

A walkthrough of ruby code tools, brakeman, simplecov, rack-mini-profiler, and RuboCop.

http://chriskottom.com/blog/2015/01/code-quality-metrics-that-matter/

Profiling Ruby

Two different items on profiling in Ruby.

Ruby, Trace, Leave, Oh my! covering the Ruby 2 TracePoint API

RBKit a Ruby profiler with a GUI for OSX or Linux. Looks similar to VisualVM in Java.

OSX

Shuttle

Mac menubar app to automate SSH commands. Nice short overview here, the project is on github.