Railstips.org
#38

Home // RailsTips by John Nunemaker

lmao if you don't make it easy for users of your library to log, measure and graph everything. October 10, 2012. Posted by John. Booleans are Baaaaaaaaaad ...

Link: railstips.org

  • Let Nunes Do It

    railstips.org 18 Apr '13, 8pm

    In a moment of either genius or delirium I decided to name my newest project after myself. Why? Well, here is the story whether you want to know or not. Why Nunes? Naming is always the hardest part of a project. Originally, it was named Railsd. The idea of the gem is automatically sub...

  • Include vs Extend in Ruby

    railstips.org 05 May '13, 9pm

    Now that we know the difference between an instance method and a class method , let’s cover the difference between include and extend in regards to modules. Include is for adding methods to an instance of a class and extend is for adding class methods. Let’s take a look at a small exa...

  • Data Modeling in Performant Systems

    railstips.org 02 May '13, 8pm

    Great stuff. Starting a new project and evaluating this vs. Ohm. Our target is primarily Redis but I could see Mongo in the future and like that this is ActiveModel based. However, echoing some of the above comments, it seems deficient in not only multi-get and transaction support but...

  • Four Guidelines That I Feel Have Improved My Code

    railstips.org 16 Apr '13, 2am

    Regarding naming … absolutely agree. It is worth arguing about. The more critical the class is to the system design, the more I might go to the mat and wrestle a good name to the ground. The decision on a name can be a fleeting event, but it will have everlasting impact. Think: Write ...

    Related:
    1. More Tiny Classes railstips.org 16 Apr '13, 3am
    2. Keep 'Em Separated railstips.org 16 Apr '13, 3am
  • lmao if you don’t make it easy for users of your library to log, measure, and graph everything.

    An Instrumented Library in ~30 Lines

    railstips.org 23 Jan '13, 8pm

    For the first time ever, I am going to lead with the end of the story. Here is the full ~30 lines that I will break down in detail during the rest of this post. require 'forwardable' module Foo module Instrumenters class Noop def self.instrument(name, payload = {}) yield payload if bl...

  • Unless, The Abused Ruby Conditional

    railstips.org 30 Mar '13, 12am

    The only people that don’t like “unless” are either: A) Old school programmers, which I can understand. B) Blog followers, the people that let the hip blogs choose their mindset. I’ve personally thought, from back in my C/C++ days, that “if not” sounded like the most obscure piece of ...

  • Bedazzle Your Bash Prompt with Git Info

    railstips.org 07 Feb '13, 10pm

    I have seen this around and this morning finally decided to try it out. Thus far I am finding it surprisingly helpful. If you put the following in your bash profile, it will show the current git branch in your terminal prompt. bash profile addition function parse_git_branch { ref=$(gi...

  • More Tiny Classes

    railstips.org 16 Apr '13, 3am

    My last post, Keep ’Em Separated , made me realize I should start sharing more about what we are doing to make Gauges maintainable. This post is another in the same vein. Gauges allows you to share a gauge with someone else by email. That email does not have to exist prior to your add...

Related