avatar

GitArborist One Month Update

GitArborist.com has now been live for one month. With the aim of “building in the open”, let's have a quick look at what's changed, what's planned, and what surprised me. March 2020 Stats First, the stats: Total Installations: 3 PRs Merged: 1 What's Changed This month I did a lot of rework of the code. I had a self-imposed deadline of launching by the time my article was up on the Honeybadger Blog, reasoning that this was a potential source of traffic and I wanted to be able to direct that traffic to GitArborist.

Introducing GitArborist.com

Carving a Path Through Wild Branches Photo by Studio Dekorasyon on Unsplash Git is a fantastic version control system, no question. I've been using it since maybe 2012, though at that time it was through a TFS-Git bridge so I could enjoy local (and cheap) branches while the rest of the company used TFS. Of course, with git you also need a central place to push your code where other developers and your infrastructure can access it.

Running Ruby on Rails 6 on a Raspberry Pi Zero as Easy as Heroku

In this post, I'm going to take a look at what it takes to get the latest version of Ruby on Rails (at the time of writing that is Rails 6.0.0 on Ruby 2.6.3) running on a Rpi Zero W. First, let's answer the burning question of why would anyone do this: Because I can I work with Ruby on Rails in my job every day, so I am familiar with it A learning exercise about what it is like to work with balena.

Dissecting Code With Ruby's Caller Method

Here is a short snippet of code that has become one of my favourite debugging tools recently. It’s not efficient, definitely not elegant, but man is it useful. location = caller.first location = location[0...location.rindex(":")] line_number = location[(location.rindex(":")+1)..-1] file = location[0...location.rindex(":")] puts location puts File.open(file).readlines[line_number.to_i - 1] puts "#{values}" puts "--"*20 But let’s back up a moment, how did I get to this stage? Background As part of consultancy work we often inherit applications developed by other Rails shops of varying quality.

Diving into the Ruby Source Code: Understanding Ruby's Bigdecimal Rounding Options

If you're a developer and I ask you about numeric rounding, you'd probably think of something like this: Jump to the decimal place that we are rounding to Look at the digit to the right of it Based on that digit and our rounding rule, make a decision We can round up if we see non-zero in that spot (also known as “ceil”), or we can round down regardless of the digit (aka “floor” or truncate), or we can round >= 5 up and truncate if < 5 (banker's rounding).

Fixing Native Datepickers in Turbolinks Android Apps

Some client apps make use of Turbolinks-Android to provide a native Android experience for their Rails web apps. This is fine until you try to use something like an HTML5 date field. When the user taps on the field they get… nothing. No datepicker, not even a keyboard, just a flashing cursor trapped in a forever-empty field. This is a known issue with Turbolinks-Android. It appears that most HTML5 fields will work, but date/time and autofill will not.