Setup Braintree with Rails

Braintree has just recently released v3 of their Javascript SDK offering a lot of improvements. Searching online for tutorials on how to integrate Braintree with Rails tend to show older articles, so I decided to write an updated one :)

Read On →

Life Beyond Rails: Building Cross Platform Applications

This is the talk I presented during the first Ruby Conference in Kuala Lumpur, Malaysia. It’s not a word-for-word transcription, but this is mostly the same material I wrote to prepare for the talk.

Life Beyond Rails

The secret to creating cross platform apps is something you already know, but probably not doing.

Read On →

Featured Pattern: Rescue, Log, Rethrow

Whenever you use a method that you know might throw an exception but shouldn’t, the rescue-log-rethrow pattern is useful to figure out what happened while preserving the contracts implied in the code.

Read On →

TDD and the Scientific Method

TDD’s mantra is the following: Red, Green, Refactor. In other words: write a failing test, write code to make the test fast, and then make the code better (having the test as a safety net).

Read On →

Featured Refactoring: Extract Method

I work with really awesome people who do really amazing work. I came upon this commit recently while I was reviewing a pull request, and I thought I’d share them with you.

Note that some of the information on the diff presented here has been redacted or removed, due to it being proprietary. But the full idea of the refactoring is present.

Read On →

A Strange Case of Inheritance Behavior

While working some code to work with the Zuora SOAP API, I got bit by a strange case of inheritance behavior. It would seem that this is related to what self is bound to during the execution of the statement. Here it is, distilled to its essentials:

Read On →

2016 04 08 Linklog

Here’s this week’s linklog:

Read On →

Javascript Training at Mindvalley Day 2

We’ve commissioned Dekatku to train some developers here at Mindvalley on Javascript, and it’s been a great experience so far! Today is Day 2 of the the training and we’ve covered some really deep topics.

I’ve started wearing my whitebelt again and I thought I’ll put up my thoughts and notes here for future reference. At the start of the session we had one hour to make a TODO application. The caveat being that we’re not allowed to use any libraries or frameworks; just pure javascript.

Read On →

String Interpolation with Templates Using String#

I was working on a feature for upcloudify that will use Slack notifications instead of email notifications. One of the challenges I faced was how to build-in flexibility for generating messages. I would want that the user be able to provide their own custom notification message, but at the same time be able to provide placeholders for items like the S3 download link.

Read On →

Opalbox—Run Ruby Code Inside Pages

Opal is a Ruby to JavaScript compiler, and OpalBox is a jQuery plugin to easily create a textarea that can take ruby code and allow it to run.

I just added OpalBox to this blog and it’s been quite interesting. I’ve learned how to resize a textarea based on its content (you need javascript to do that because CSS just doesn’t cut it) and I’ve added in a shortcode.

update:

Read On →