MetaSkills.net
Coding things under other things!

Welcome!

Jekyll-Style Blogging On Rails

Do you want to use your existing Rails' layouts & business logic for your new Blog? Do you know and love Jekyll, but cant seem to get the two to play nice together? In the spirit of doing the simplest thing that could possibly work, I set out on a solution to this problem. Besides mimicing Jekyll as closely as possible, my requirements were loosly defined as: Use a directory of markdown files with a YYYY-MM-DD-blog-post-title.md naming convention. Have fast...

Thanks To My Mother For The Career I Have Today!

As a white male in the computer industry, I have never felt like I could add value to the conversations that call for diversity and respect to all those that share the same passions I do. Instead, since teaching myself to program several years ago, I have worked very hard to openly advocate the love I have for software development through our local @757rb user group and whomever would give me a platform to do so. Never murmuring a comment...

Instrumenting Your Code With ActiveSupport Notifications

Have you ever wondered how tools like New Relic are able to gain valuable metrics to your Rails application's internals? Or maybe you are interested in learning how to write your own libraries and gems so they can be instrumented using those same techniques? Once again the answer is to look deep into the Rails source code – and the answer is ActiveSupport::Notifications. A simple and powerful instrumentation API for Ruby available in Rails v3.0 and upward. Today I want...

Using Dotenv In Rails

Environment variables as a configuration means are everywhere in Ruby. For instance, ActiveRecord will use the single DATABASE_URL environment variable for every part of it's configuration, no database.yml needed! If you are not on board with environment variables, check out The Twelve-Factor App for configuration. This is exactly how good software platforms like Heroku work, all through environment variables. But using environment variables in a Rails application can be tricky. During local development, you may not want to set everything...

Jekyll Tips And Tricks

IT'S DANGEROUS TO GO ALONE! TAKE THIS! Our t-shirt fund-raiser on Booster.com only has a few days left. Don't miss out on this 8-bit-tacular Ruby shirt! Available in men, ladies & youth sizes! Last week, our localy Ruby community in Norfolk, VA re-launched the 757rb.org website. This was the third static website I have build using Jekyll and the second since the official v1.0.0 release. It was also completely different than any creative approach I have taken on. Please, go...

In Loving Memory of Kenneth Earle Collins

Kenneth Earle Collins, 66, of Chesapeake, Virginia, passed away January 5th, 2013. My father, known to his friends and family as Kenny, was born in Logan, West Virginia and was the son of the late Edgar and Frances Collins. He was a retired Master Deputy with the Chesapeake Sheriff's Department. Kenny is survived by his beloved wife of 7 years, Lois V. Collins; a sister, Lanna DeVites and husband John of Zuni, VA; 4 sons, Benjamin M. Collins and fiancée...

HolyGrailHarness

The latest README for HolyGrailHarness will always be on the Github project page. A curated Rails application prototype that focuses on simple test patterns for Ruby & JavaScript! Unlike normal Rails Application Templates or more modern Rails application generators like Rails Composer, the HolyGrailHarness is a basic Rails application that can be considered a prototype and customized via a simple setup script. It is also somewhat opinionated in that it promotes simple and powerful testing choices and focuses on using...

Synchronized Times In Ruby & JavaScript Acceptance Tests Using Capybara, Timecop & Sinon.JS

Any good Ruby developer that tests time-dependent code has used the Timecop gem. Timecop provides dead simple time travel and freezing capabilities to Ruby's standard library. But what if you are working on a rich JavaScript application that is backed and tested by something like a Rails application and you want to alter the test browser's clock as well? The answer is pretty simple, but let's first examine all the parts at play here. Rails & Capybara My examples leverage...

Rails, Moment.js And Time Zones

Here are a few quick tips for the time zone aware Rails developer that finds themselves deep into JavaScript date objects. First, use the Moment.js JavaScrpt date library! Moment.js has a very rich API for parsing and working with times, very similiar to ActiveSupport's extensions. However, it does not have a solid way of moving times across zones. Especially if those zones may or may not observer daylight savings time (DST). Many JavaScript time zone libraries require a huge set...

View Controller Patterns With Spine.JS & SpacePen

The VC in 'MVC' As Addy Osmani points out in his Scaling Your JavaScript Applications presentation, all JavaScript 'MVC' frameworks interpret MVC differently. These differences are an academic rabbit hole and if you are really interested about them, I recommend reading some of the resource links at the bottom of this post. One in particular by Jonas Nicklas really outlined how I think client side JavaScript applications should be developed. It is titled Why Serenade.js and in it, Jonas describes...

StoreConfigurable - A Lesson In Recursion In Ruby

When ActiveRecord 3.2 was released there was a small addition called ActiveRecord::Store which bills itself as a simple key/value store for your models. The code below is pulled right from their example usage. class User < ActiveRecord::Base store :settings, accessors: [:color, :homepage] end @user = User.new(color: 'black', homepage: '37signals.com') @user.color # => 'black' @user.settings[:color] # => 'black' @user.settings[:remember_me] = true Most people know that I love simple tools. But when I found myself considering ActiveRecord::Store, I found it seriously lacking...

Too LESS? Should You Be Using Sass?

Previously I had updated this article to say that this commit looked like it gives you real variable properties in LESS. I was wrong! So even in LESS v1.3 you are still screwed for doing metaprogramming and working with a real CSS preprocessor. That may change for LESS v1.4 and if you want to help make that happen. I suggst you put your weight behind this github pull request. First, a little bit of background. A while back ago I...

Pretty Console Logging With Guard::Jasmine & Black Coffee

OK I know I promised that we would start the dive into testing your Spine.JS application using Jasmine(rice) in my last article, but this is a good diversion. If you are new to my latest series on Spine.JS and Jasmine, scroll on down to the bottom to the related section and read back. However, for those that might be more familiar with Jasmine and specifically Guard::Jasmine and ever felt the pain that debugging from that terminal window was lacking, read...

Rails & Spine.JS - Jasmine Testing Part 2

So this is the third part to my mini series on Rails and Spine.JS. Part one covers an initial setup and how to include Spine.JS into your Rails project while part two is actually the first of a tome on how to test your Spine.JS application. Assuming you have covered the bases there, lets get right down to business and review some of the elegant hacks ™ yours truly came up with while testing my own Spine.jS application using Guard...

Rails & Spine.JS - Jasmine Testing Part 1

In my previous article I talked a little bit about why I decided to use Spine.JS and how to include the CoffeeScript source into your Rails project using git submodules. Now I would like to talk about testing your brand new Spine.JS application. Afterward, be sure to read the second part to this article which covers more advanced aspects of your Spine.JS application specs. Testing JavaScript OK, so like any good programmer, you want to test your JavaScript web application,...