READ THE LATEST

Archive

Fix Github’s missing green boxes on commits

When I setup a new development environment, I’ll commit my code to GitHub but the green boxes won’t show my contribution for that day. It’s usually because my git email / name is incorrect. The fix is pretty simple. Type the following into the command line: Try to commit and

Read More »

Using Ajax in Rails Forms

Sometimes you want to update a form and not refresh the page. This is where AJAX (Asynchronous Javascript) comes handy. Instead of the controller responding with an html page, we’ll have the controller respond with Javascript and update the page. Let’s create a list of restaurants by creating a Rails

Read More »

Ruby nil, && operand, and no method error

I wanted to show a link in a Rails application based on whether a person was current_user.admin? and signed_in? The code looked something like this: That would work when I was signed in but as soon as I signed out, I’d get a no method error. That happens because when

Read More »

Using HAML in Rails Helpers

Using HAML in Rails views is great because its more succinct than ERB. Using HAML in Rails helpers was a source of confusion on my end. Here’s what I learned about using HAML in helpers. I wish that I could use HAML directly in Rails helpers just like I use

Read More »

Interact with JQuery from the browser console

I recently stumbled on this technique where you can load JQuery for ANY page and write JQuery commands right in the browser console. This is great for debugging and exploration. Method 1 – Bookmark Injector Straight from this post on stack overflow. Create a bookmark in your browser and for

Read More »

What the heck is EOS? (Book Notes)

The company I’m working with started to use EOS (Entrepreneurial operating system) to manage vision, priorities and making sure everyone is clear about what the company is aiming to achieve. I don’t recommend you read it unless your company is implementing EOS and you need to know the framework. The

Read More »

Drop big rocks in the Jar first

This analogy is about putting important things first. Sounds like the same old crap you hear from self-help books. However, I admire a good analogy that sticks in my head and this is one of those. This analogy comes from Stephen Covey. Imagine you have a jar and you have

Read More »