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 […]

Parallel Assignment

Here’s a cool trick for dealing with situations where you want to assign multiple values at the same time. The technique used is called parallel assignment and it looks something like this:   View the code on Gist.   If you’re working with game boards, this is super useful way to pass around board coordinates!!

Something to Lookout For

If anyone actually reads this, here’s an unusual circumstance to look out for… circular object references that cause Pry to go BSC. (For those who don’t know, Pry is a Ruby shell that can be used as a replacement for the default Ruby shell, IRB (like IPython for python people).) Today I witnessed a pretty strange […]

Merge and Rebase

Some notes on thee specifics of merging vs rebasing with Git. What is a Merge? When you merge one branch into another branch the branch being merged into receives a single commit that basically brings it up to the current state of the source branch. This commit is created automatically by git and essentially represents […]

Building Mastermind

AppAcademy had us coding some games today! Specifically, Mastermind and Hangman. When my pair Brittney and I started this we had both never heard of mastermind; so that was the first challenge. Turns out mastermind is pretty straight forward AND it’s actually a really cool game. Let me explain the rules of mastermind first… You […]

Pairing and Balance

Under construction still… Today was Awesome.  In my past experiences I’ve found that pairs balance out as they work but with Kriti I think we balanced out as a whole.  To explain that a bit further… Kriti is incredibly strong with recursion problems … like straight up a bad ass (and I have a line […]