rubycoloredglasses


I'm Jason, a web applications developer in the Denver, Colorado area.


  1. POW RVM ZSH

    I’m using a Rails 3 app, and my colleague updated the RVM config to use Ruby 2.0.0. I was having issues getting POW to work with the app. I’m using ZSH as my shell also.

    The following command resolved my issue.

    rvm env . -- --env > .powenv
    

    Props to Linus on StackOverflow for this solution.


  2. Devise_For with Skip

    I just stumbled upon the options for devise_for which let you auto-generate the routes that are needed for a certain devise resource (user), with certain categories of routes skipped.

    For example, if I want to define routes for my User, I can define:

    devise_for :users
    

    This results in the routes for these three categories:

    • Sessions - Sign in, Sign out
    • Passwords - Password reset options
    • Registrations - Creating new user, updating existing user, or destroying your user account

    You can leave one of these categories out of the route definition by using skip. For instance if you want only the Sign-in and Sign-out options, you could define this in your routes.rb file:

    devise_for :users, :skip => [:registrations, :passwords]
    

  3. Project / Task Management Applications

    I’ve worked on various projects that used various task management applications hosted in the cloud (software as a service). I hear about new ones every so often, so I decided to note them here for future reference.

    • Pivotal Tracker - Anyone trying to adopt the agile / scrum method of development has likely used this.
    • BaseCampHQ.com - This is the first Rails application. The reason Ruby on Rails exists. Simple and elegant.
    • Wrike.com - Very flexible. Can be used to multiple people, in different organizations, matching any special hierarchy of tasks.
    • PlanScope.io
    • Asana.com

  4. Refinery Extension Not Named After Model

    A project I’m working on currently relies on Refinery CMS to administrate the pages. Instead of building our own separate admin area for our own custom models, we’re continuing to use Refinery for our non-page models as well.

    Refinery and it’s extensions are generated under their own namespace to ensure that they play nice with any system you install Refinery into. It can provide page management inside of an existing Rails app you have, or it can act as the center of the entire website. I’m pretty sure the main concept is that it leaves the view/layout presentation up to you, but provides the page administration back-end for you.


  5. Splitting a Branch with Git

    There are times that a task you are working on results in an extremely huge amount of changes. Although you may have been careful, and tested each modification out well, there is always a possibility that something will cause an issue in production. If your branch contains modifications that can be released in separately, without interdependencies, it’s a good idea to split the feature branch into separate releases.

    First you’ll want to interactively rebase your branch, squash all commits into a single commit, and then amend the remaining commit so that it’s the most recent.

    git checkout my_feature_branch
    
    git fetch
    
    git rebase -i origin/master
    
    git commit --amend --reset-author
    

  6. Application Builders

    Everytime I setup a new Rails application I have to go through the configuration and change many things. It’s as if there is a specific configuration that I prefer. For instance, I like using the Twitter Bootstrap framework for my front-end…at least just to get started. I like to use Rspec and Cucumber for testing. The list goes on.

    I just stumbled upon this argument that the ‘rails’ executable provides when generating a new Rails application.


  7. Technical Debt

    If I were to pick one area of advice for any aspiring business men seeking their Master of Business Administration degree, with the intent of working for a company that involves developers, I recommend that you explore this concept. If you’re unaware of this possibility, your project might eventually end up drastically behind.

    Technical Debt


  8. Why Ruby Was Named After a Gemstone

    Matz: Ruby is named after the precious gemstone, it’s not an abbreviation of anything. When I started the language project, I was joking with a friend that the project must be code-named after a gemstone’s name (àla Perl). So my friend came up with “ruby”. It’s a short name for a beautiful and highly valued stone. So I picked up that name, and it eventually became the official name of the language.

    Taken from An Interview with the Creator of Ruby by Bruce Stewart


  9. Über-Securing Ubuntu 12.04 LTS with Mod-Security + Ruby on Rails 3.2.13

    By Marshall Sontag

    I recently setup a linode server for a new client who wanted the best security practices installed.

    Most linux security guides instruct you to disable password authentication and enable SSH key authentication for SSH and use iptables to allow or block certain ports. But I found this incredible guide that takes it several steps further to prevent IP spoofing, DDOS attacks and much more.

    How to secure an Ubuntu 12.04 LTS server - Part 1 The Basics

    It also incorporates mod-security rules from the Open Web Application Security Project, which I just learned about through this tutorial.


  10. Downloadable Documentation

    Some people want to download the documentation for the languages they’re using. This is needed when an internet connection isn’t available (like using a laptop on a plane), or even for the sake of speed.

    Here are two sources of downloadable documentation.