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