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):
ps. this is a joke, don’t do any of this stuff… or do it! YOLO!
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):
ps. this is a joke, don’t do any of this stuff… or do it! YOLO!
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…
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 understand a database index, it’s helpful to consider the analogy of a book index. In a book, to find all the occurrences of a given string, say “foobar”, you would have to scan each page for “foobar”. With a book index, on the other hand, you can just look up “foobar” in the index to see all the pages containing “foobar”. A database index works essentially the same way.
Bam!
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 double pipe equals, which will be referred to as “||=” from now on, is an operator that’s used for conditional assignment.
In a nutshell the||= operator’s usage is something like this:
blah ||= blabbity_blah()
This essentially says: “if blah is false then set it to blabbity_blah(), otherwise leave it set to whatever it was before we started”
Here’s a contrived, but-still-real-code, example lifted (and modified) from Wikibooks: