Restrict an integer to a specific range in Ruby

posted in today i learned


Ever wanted an integer to be allowed a specific range of valid numbers rounding when necessary? Well, unfortunately in the Ruby community this has been a point of contention because no built-in function exists. We can however easily replicate the intended behavior through the clever usage of the enumerable sort method.

Rails 4 turbolinks fix for jQuery only working after hard refresh

posted in today i learned


The Rails asset pipeline uses a feature called Turbolinks for serving faster CSS and JS assets to the browser. It works by using AJAX to re-load assets without refreshing the page. Unfortunately, it also can mess up scripts that work with the document ready event such as jQuery. The only way to make the assets work is with a hard refresh. Let's fix this.

Getting up and Running with Minitest, Guard, Sass, and Bootstrap for Ruby on Rails Development

posted in articles


I've always felt that getting up and running with a new web development project should be as easy as possible. A good example of this is a Rails app. As Ruby on Rails accomplishes a high degree of ease of use straight out of the box, this article will focus on setting up an automated testing environment and sprucing up your CSS with bootstrap-sass.

Advanced Techniques - Part 2

posted in series


Since the last Sass article in this series was published over a year ago, here is a quick refresher. We covered the setup of Sass apps including: Guard, Compass, Prepross, and Scout. There was also info on variables and rule nesting. And we talked about why Sass is so awesome. In this article we are going to go through some more advanced techniques specifically: Functions, Mixins, Placeholders, Parent selector, Calculations, and conditional statements.

How to configure Sublime Text for PSR Standards

posted in articles


Created by the PHP-FIG, the PSR specification is a unified push to create standards across all PHP projects. The committee is formed from over 20 developers representing some of the most popular frameworks. Having a unified standard has been a much needed endeavor since PHP standards have been somewhat lacking in the past.

Guard fix for could not start Spork server for Rspec

posted in today i learned


While working through the expertly written "The Ruby on Rails Tutorial" by Michael Hartl, I ran into a small configuration issue. The issue I experienced was with Guard not properly starting a Spork server from the command line. My system was able to run Rspec, Spork, and Guard with no errors as long as Guard didn't try to load Spork. Here is what my terminal output looks like.

5 Ways to improve your development workflow

posted in articles


When I was in college learning about web development back in 2005 (yeesh), I was always looking for the perfect method of programming. At first I thought "if I can only find the perfect way of doing this, I'll never have to learn it again". Of course with web development and life, perfection should only ever be a direction not an ending. Let me explain.

  • 5
  • 6
  • 7
  • 8
  • 9