November 13, 2015 by Daniel P. Clark

Rails Rumble – the Experience

Rails Rumble is a yearly programming challenge.  Each team is given 48 hours to complete and publish a website written in Ruby.  You are permitted solo entry or up to 4 people as a team.  You can do no coding of the project beforehand, but you can draw up and discuss plans as much as…

Continue Reading »

September 21, 2015 by Daniel P. Clark

Introspection by Design in Ruby

If I have one pet peeve in Ruby it’s knowing state at a certain point in the program’s process.  Sure they make plugins for advanced diagnosis of this.  And when you start out learning to program it’s common practice to use puts everywhere to see what’s going on.  But this causes a lot of back…

Continue Reading »

July 25, 2015 by Daniel P. Clark

Play HD Youtube from the Raspberry Pi Command Line

Quick tip for most Linux distros.  You can just use the mpv player to play a Youtube video from the command line.  It’s a take off on mplayer2, and it has quvi built in.  Unfortunately it’s not available for the Raspberry Pi architecture. Now the Raspberry Pi has some pretty good graphics built in.  But…

Continue Reading »

July 23, 2015 by Daniel P. Clark

Ruby on the Raspberry Pi (free distro image)

I’ve customized my own Raspberry Pi distro (Raspbian) with Ruby 2.2.2 on it.  It’s available for download for you to use.  Here are the details. 4 GB image with 370Mb of free space at a download size of 1.9Gb DOWNLOAD Custom Ruby 2.2.2 on Raspbian Distro (ruby_rpi.img.bz2) User: pi Pass: raspberrypi Checksum: md5sum ruby_rpi.img.bz2 53637c11e3115381ac5867391f527f75…

Continue Reading »

June 21, 2015 by Daniel P. Clark

Ruby Refinements – Not quite ready for production

I recently looked for a method on Array for a boolean response on its uniqueness.  As Ruby currently doesn’t have one I figured it’s easy enough to write one.  Now Ruby’s refinements are fairly new and a nice feature to have around.  So I decided to write a benchmark for different ways to test the…

Continue Reading »

May 2, 2015 by Daniel P. Clark

Private Module Methods in Ruby

So this is something I’ve looked into many times over the years and have never found an answer to.  But great news is that I’ve found a way! It’s as simple as defining module methods as private within the singleton class.  Here’s how I did it in my gem PolyBelongsTo module PolyBelongsTo::Core extend ActiveSupport::Concern included…

Continue Reading »

April 8, 2015 by Daniel P. Clark

Documenting Your Code

I’ve been hearing a majority of developers saying things like “You’re code should be easy enough to understand that you don’t need to document it.” and “Comments are lies waiting to happen”.  I was okay with this and after hearing this for a while I eventually stopped writing code comments. I watched a conference talk…

Continue Reading »

March 20, 2015 by Daniel P. Clark

Hooks

When trying to ensure that something happens around some kind of event it’s usually best if you work with a hook designed for that scenario rather than manually implementing one.  This becomes most evident in JavaScript events with jQuery and Bootstrap effects.  If you write an event listener for some change around these effects without…

Continue Reading »

March 12, 2015 by Daniel P. Clark

Substitution with Regex Groupings

As I continue to grow in experience I was looking into how I might do some in-place substitution that I had been accustomed to performing with array matching (split-map-join).  What I’m referring to isn’t just a letter for letter substitution, but something that would find a match and modify it.  For example; if I wanted…

Continue Reading »

March 9, 2015 by Daniel P. Clark

Ruby: Actionable Meta

The more you program the more likely you will need to change a string to the object the string represents. For example you may have a string with a mystery class name in it the you need to call methods on. Lets go a step further, lets say the method you need to call on…

Continue Reading »

Page 2 of 5
1 2 3 4 5
1 2 3 4 5