Using Underscore.js templates within ERB

You don’t always have React to create a new feature on a website. Recently, I used Underscore and jQuery within a Rails application to create a dynamic page.

The secret to getting good at anything with minimal effort

I never intended to go into software during high school. I thought I was going to be a doctor, yet on the side, I managed to amass a good amount of experience in all sorts of technologies. While learning all of these things, I never really tried. How is this possible?

Ruby WTF? Escaping single quotes in Ruby using gsub

I’m currently working on a project which requires me to escape JavaScript (don’t ask why). To get it working, I had to escape single quotes. I was encountering weird behavior in my code, so I ran the following in IRB.

The benefit of destructuring function arguments in ES6

ES6 brings a lot of great features to JavaScript to make it a much more modern and powerful language to work with. The days of “JavaScript sucks because it was only built in a week” have passed. One really great feature in ES6 is destructuring.

Doing homework assignments in Markdown using Pandoc and LaTeX

Markdown is a really awesome format for text and prose. It’s really easy to manage in any text editor, and it’s quick to write. It has a lot of features, including bolding, italicizing, lists, quotes, embedded code, and more. It’s so easy to write that it’s the “language” of choice for many major websites such as StackOverflow and Reddit, it being much easier to implement and looking nicer than a WYSIWYG text editor. I’m even writing this blog post using Markdown. However, you can’t really send someone a Markdown document. It’s meant to be processed into a more readable format, most usually HTML.

Using form-horizontal with simple_form in Rails 4

simple_form is a really great gem for generating bootstrap forms. However, you have todo a little extra to get it working with Bootstrap’s form-horizontal class. TheREADME doesn’t mention this, but it’s built in. Just write your form declaration like this:

How to skip all Yaourt prompts on Arch Linux

Yaourt is probably the best tool to automatically download and install packages from the Arch User Repository, also known as AUR. It’s really powerful; however, by default, it prompts you a LOT for confirmations of different things, such as checking if you want to install something, if you want to edit the PKGBUILD, etc. As a result, Yaourt is pretty annoying if you’re used to the hands-free nature of most other package managers.

Why hard work doesn't matter

Hard work pays off. That expression is always said in today’s society, and it’s considered a good trait to have. However, many people every day work hard, yet they still find themselves struggling to pay bills or live.

Why abstraction is important when constructing algorithms

In order to get better at algorithms (my greatest weakness), I’m currently going through the Stanford algorithm design course. To learn the concepts better, I decided to implement Karatsuba multiplication in JavaScript. (The fruits of my labor can be found on my miscellaneous algorithm GitHub repository.).

The real reason why Caps Lock and Escape are in terrible positions

It is a truth universally acknowledged that the Caps Lock key is completely useless. I use it about once or twice a year, and that definitely does not warrant it a spot right next to my pinky finger on the home row. It’s in a place that is just as convenient as the Enter key, despite being completely useless.