Hi, I'm Laust Rud Jacobsen, an experienced webapp developer specializing in Ruby and PostgreSQL-based solutions. You can hire me to build awesome stuff for you. Your idea needs somebody who understands the tools, and can puzzle out the trickiest of issues. I hold a M.Sc. in Computer Science, and I use that foundation to build efficient, maintainable and understandable solutions. I have been working full-time on Rails-projects since early 2008, and have been test-driven since day one. I live in…
I have recently taken up FPV drone flying. It is both difficult and satisfying. /r/fpv has been a helpful community in getting started and finding great gear that works well together. One thing I came across was a recommendation to enable pre-arm on your drones, but it took some research to figure it all out as a beginner. Setting up pre-arm means you need both hands engaged to arm your drone…
Upgraded an app to Rails 5.0.7, and after following the official migrations steps, the app completely failed to load. The exception itself was rather puzzling: undefined method 'logger' for nil:NilClass (NoMethodError) , raised deep inside of ActionCable at lib/action_cable/engine.rb:20 : initializer "action_cable.logger" do ActiveSupport . on_load ( :action_cable ) { self . logger ||= :: Rails .…
A typical first impression of running rubocop on a large project: 669 files inspected, 1700 offenses detected Where to start. I’ll tell you. Welcome to the “Rubocop for Large Projects” guide. How did we get here? Long-lived and valuable software projects typically pass though the hands of multiple maintainers. Each maintainer provide their unique insight and leave a fingerprint on the code. During…
Using the Rails asset pipeline makes it safe to cache assets forever in browsers. Rails is configured for this out of the box, so you only need to ensure that you precompile assets before or during each deploy. With that out of the way you can simply add this snippet to your nginx config to allow assets with digests in their name to be cached forever in clients: # From…
How do you get started doing effective maintenance development? This topic is near and dear to me, as I’ve spent most of my career writing new functionality, but also to a large degree getting good at cleaning up and extending code written by others. There are some knacks to doing it well, and I’m in the process of writing write a practical guide to help you learn it faster. Style guides are topic…
Consistency makes code easier to read. Long-lived projects can be a wildly inconsistent in their ruby hash syntax, so here is a quick way of upgrading all symbol-based hash-keys to the new leaner format. Simply put: perform the below operation to convert :thing => 'value' to thing: 'value' in one easy step. Please remember to commit everything first so you have a clean slate to start out from, and…
Flash messages in Rails applications need a bit of love. A lot of them tend to be identical within a given app, and it’s a bit annoying to manage defaults and fallback for all these calls to I18n.t() . The following is a small helper-method and a simple structure to keep it all neatly organized. For this to work, add the text you want shown to your config/locale/en.yml (by default): en : posts :…
This is a guest-post by Cameron Dykes , about getting started with the ruby debugger. A key step to debugging any program is replicating the environment to ensure you can consistently produce the bug. In my early Ruby days, to inspect the environment, I used a primitive method: placing puts lines in my code to print values to the console (let’s call them “inspection puts”). It may have looked…
whiskey_disk makes it very easy to quickly deploy a new version of your site to one or more servers. It’s very efficient, as files are copied directly from your git repository to the server. This means you can very quickly make large deployments even when you are on a slow internet connection. You do need a secure way for your server to access the git repository while the deploy is going on, read…
Years ago I read Streamed Lines: Branching Patterns for Parallel Software Development , and many of the thoughts have stayed me. Think of it as a catalogue of Design Patterns for version control workflows. There are so many ways to efficiently use branches to both collaborate and isolate work. Lively discussions can be had on how to best organize a repository, and having a great overview of the…