Ruby’s % Notation

For some reason my brain has defected and has chosen a life of NEVER being able to recall basically anything related to Ruby’s % notation. After seeing this list on a recent Arkency blog post (an awesome blog) I’ve decided to steal repost it here for my own personal reference.   %q[ ] # Non-interpolated String […]

Git: Rename Author / Committer Across All Commits

Sometimes you accidentally commit code under the wrong author or committer credentials.  This has happened to me a few times while writing code from computers with global git settings.  By using `git filter-branch` it is possible to rewrite history… muhahahah! This snippet will run through your branch’s historical commits and rename the author and committer attributes. It basically looks […]

Who Said That One Violent Psychopath Quote?

There’s an amazing quote I see floating around the Internet sometimes… “Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live” The quote is sometimes mistakenly credited to Martin Golding in 1994. The reality is that in 1991 John F. Woods authored it in […]

Git: Amend

Have you ever had this happen to you? You finish writing some awesome code.  You’re a bad ass and you know it. You hit the command line, because you stopped creating GUI interfaces using visual basic a long time ago. Issue a little “git add” here and there, add some broth, a potato.  Baby, you’ve […]

YDD Guidelines – YOLO Driven Development

For anyone who’s just starting to get into YDD (YOLO Driven Development), here are some good guidelines put together by GitHub user Todor Grudev (tagrudev):   View the code on Gist. ps. this is a joke, don’t do any of this stuff… or do it! YOLO!

RSpec/Rails Cheatsheet

Lately I’ve been writing a TON of tests using RSpec and Capybara.  The syntax keeps slipping my mind so here’s a cheat sheet I keep coming back to…   View the code on Gist.

Hartl’s Description of a Database Index

Today at AppAcademy we have gone through almost all of Michael Hartl’s rails tutorial.  I just wanted to quote Hartl explanation of what a database index is and how it works.  I love the analogy because it’s probably the most simplistic examples I’ve probably ever seen: Putting an index on the email column fixes the problem. To […]

||= WAT?

First off, I stole this pic from Greg Pike’s post about Javascript.  Now that the confession is out of the way… Today at App Academy my pair and I were asked to explain the meaning of Ruby’s “double pipe equals” operator  to our cohorts.  I figured that might be a good topic to post here. The […]

[‘Cogito’,’ergo’,’sum’].product([‘renè’, ‘descartes’])

Here’s a cool chain of info nuggets that starts @ Renè Descartes and ends @ Ruby’s Array.product, lol. Renè Descartes was a French philosopher and mathematician born in 1596. He’s known for lots of things but one of the most popular is the following quote  from a passage in his publication Discourse on Method (1637): “I think, therefore I […]

Quick and Dirty: Public vs Private vs Protected

Ruby provides 3 ways of classifying a methods in a Class: Public, Private and Protected.  These keywords are used to declare a method’s visibility and essentially what you’re doing is restricting access to the individual methods contained in your class. Here’s a quick and dirty about the differences: Public These methods are accessible by anyone who calls […]