Journal

Short form thoughts and photos posted on the go.

Feb 23, 2018

Lessons from 2017

A quick overview of interesting lessons, tips, and ideas from my journal.

Tips

  • How to disable GNOME global media keys to customize them in i3wm
  • Blazer is a great gem for ad-hoc SQL reporting in production 🎉
  • xdotool is very powerful for scripting GUIs in Linux

Lessons

  • Keeping a professional and personal daily journal is incredibly valuable
  • Kernel bugs are real and can cause Postgres to be killed due to incorrect memory calculations
  • Upgrading from Rails v4.2 to v5.0 isn’t easy
  • Pair programming is a great interview technique, but calibrate your expectations
  • Now is the best time to make use of application feature flags like flipper
  • Using ActiveRecord::Base#default_scope has many pitfalls
  • Always plan for network downtime when building app integrations 🤔
  • Error tracking services, like Rollbar, are incredibly useful
  • Library code like activerecord-import can contain very subtle bugs

Interesting Facts

  • Setup a tiny vim function with xdotool to auto-refresh Firefox while writing markdown documents
  • Built a cache primer tool for ActiveAdmin views using ActionDispatch::Integration::Session directly
  • Trellis is super convenient for self-hosting a WordPress site with Ansible
  • WordPress has an incredibly feature-rich plugin community
  • With a small modification, AnyLogin can enable impersonation of users to test permissions in production
  • Built a restore_db script to automate restore and replace of development databases
  • Wrote interesting SQL to identify if a lead is auto-clicking emails from Marketo activities
  • Scripted and recorded a short video for a product feature using Screenflow
  • Discovered the horror that is the HTML/CSS generated from a purchased WordPress theme 😱
  • Participating in the 30-day Code Quality Challenge was fun
  • New projects on Postgres should start with pgsync as a means of data syncing

Skills

  • Tuning Postgres on AWS to achieve better I/O performance and increase cache hits is tricky
  • Learned about all things marketing in Marketo with smart campaigns, triggers, forms, landing pages, etc.
  • Brushed up on my Python skills for a short project
  • Researched the use and reporting of UTM parameters
Oct 13, 2017

Devdocs.io for Vim

I’ve used DevDocs.io for quite a while now and find it so very helpful. It has all the docs you might find in an app like Dash, but available in the browser on all OSes (it works offline too). If you aren’t using a documentation tool already, I highly recommend DevDocs.

Once you’re familiar with DevDocs, I suggest integrating it with your editor. There are probably many integrations but I’ll be covering the installation of devdocs.vim to quickly access docs from vim.

Installing devdocs.vim

Install the plugin using your vim plugin manager of choice, I like vim-plug. Add the following to your .vimrc between the plug begin/end functions:

" In your .vimrc
Plug 'rhysd/devdocs.vim'

Also, setup some basic configuration that scopes the search to specific sections of the documentation. Below we’ll setup ruby files to search within Rails and JavaScript JSX files to search React.

" In your .vimrc:

let g:devdocs_filetype_map = {
    \   'ruby': 'rails',
    \   'javascript.jsx': 'react',
    \   'javascript.test': 'chai',
    \ }

Then install the plugin from within vim:

:source ~/.vimrc
:PlugInstall

Rapid Doc Lookups

Now you can call :DevDocsAll [search-term] or :DevDocsUnderCursor to open the documentation of the word under your cursor, but this can be improved. Mapping K, which is normally the command to find documentation in the man pages, to instead open DevDocs making the flow much better:

" In your .vimrc:
nmap K <Plug>(devdocs-under-cursor)

Now anytime you’d like to find more information in the docs, hit the K in normal mode. It will open your browser to DevDocs with the search pre-filled for that specific word.

Originally posted on Hacktober Fest Blog Project

Jun 14, 2017

Jogging Challenge

Over the past five weeks (since May 2017) I’ve developed a jogging habit. It was prompted by a friendly Fitbit step competition. And I wanted to be competitive. Our group of three does the “Workweek Hustle” to see who has the most steps in a five-day workweek.

Thirty minutes of jogging each weekday is my goal. Coincidentally that is also about 5 kilometers. My next goal is to do 5K faster. This new workout requires about an hour of time — time for running, stretching, cool down, and a shower.

The gains have been significant. Now to continue improving by making it part of my daily routine.

Jun 12, 2017

Cheat40: a cheat sheet for vim

When starting with vim, or any text editor, learning the keyboard shortcuts is essential to mastery. Many articles suggest using a physical notepad to record the shortcuts you’re actively working to memorize.

And this is when I suggest the Cheat40 plugin for vim. It provides a quick command reference and is simple to customize as you progress. It opens a split (40 chars wide) with your cheat sheet, and it comes with a great example to get you started.

I add all my new plugins and custom leader commands for quick reference, otherwise I am constantly opening my .vimrc or reading the manuals. Those pauses are what I try to avoid.

Thanks to Lifepillar for the useful plugin, vim-cheat40!

Jun 7, 2017

vim, an Extensible Editor

Manually converting 40 blog posts into markdown to re-import them into a WordPress blog was repetitive and slow. But that’s why I enjoy using vim, an extensible editor.

It lets me take repetitive tasks and chain them together into a single function. And I can script complex edits into one shortcut to make my workflow more efficient, like:

  • Combine multiple blanks lines into one
  • Generate slugs names from titles
  • Fix capitalization of titles
  • Execute a macro to renumber lists
  • Preform regular expression substitutions
  • Add or remove surroundings chars like "'()[]

Doing a little tool sharpening pays back in big time savings.

Jun 3, 2017

Combining Day One Journals

Over the past three years my household has used Day One as a journal. We cataloged the short time before the birth of our first daughter and ever since. With the latest release, it is possible to have multiple journals in the app — combining them is exactly what I wanted to do. Occasionally we’d catch up on those individual moments through reading of the other’s journal, but it could be improved.

An import of the classic version yields a new journal in Day One 2. Doing an import from Day One classic on both iPhones was all that was required. Enabling sync and waiting for it to finish; then doing the sync on the second phone was the last bit. Now we can see each other’s entries immediately after posting a new one and without effort.

May 30, 2017

Journaling

To be reminded of all those small things that compose each day.

It makes for an easy method of recalling your week and planning for the next one. I can now say looking back on the year of entries, that it has made a significant impact on my personal life and work life. In total the words are only a small collection of what transpired, but it serves as a wonderful reminder of those deeper memories. In only a few minutes at a time those moments can be archived as text, photos, audio, or video.

Try journaling for yourself. Find a pace that fits you. Make the recording process as friction-free as possible. Have everything at hand when the feeling strikes.

My new entries are always one keyboard shortcut away, which opens my favorite editor ready for quick input.

May 20, 2017

A Day of Fun

Popsicles with the Family

We spent the day playing various activities with Bridget. From shopping at Target grilling, swimming in the tiny pool and jumping at the trampoline park with Paul. Plus we had some sweets like donuts and popsicles.

This project is maintained by zorab47