• Everything is My Fault

    I’ve been panic-reading management and leadership books in preparation for my new job as SVP of Engineering at Wego (something that I'll probably write about). One of the books I really enjoyed was Turn the Ship Around. This led to me devour other sources of knowledge from the author, David Marquet: his bite-sized YouTube videos and Leadership is Language are awesome.

    Before reading these books, I’d a pretty strong bias against military-flavoured leadership books — the military that I had the opportunity to be a part of did not impress my young mind as being particularly strong at leadership. And I'd judge as naive the people who try to apply what they learnt in or from the military to the business arena.

    As my past self has repeatedly learnt, there're gems to be found in unexpected, unsolicited perspectives.

    But this is blog post is not about these books – I might write about them in future because they taught me a lot about leadership and using better words to communicate what I really mean.

    Rather, I want to write about one of the most valuable takeaways from another book written by military leaders: Extreme Ownership. And it's this, paraphrased heavily by me:

    Everything is my fault. And when I see it that way, I can fix it. If someone isn’t doing what I want them to do, look in the mirror first and figure out what I can do to better enable this.

    In truth, I lied – there are 2 takeaways in that:

    1. Taking ownership of everything keeps me in a positive, problem-solving mindset.
    2. If my manager/reports/peers/executives are not doing what I need them to do, stop complaining about it. Instead, since it's my fault, ask what do I need to do.

    These are brilliant reminders for two very common occasions when working in teams: facing setbacks, and situations of unclear ownership (which often means no ownership).

    It also equips me with some handy organizational smells (akin to code smells):

    • Are people really supported when they're asked to work on an initiative? Or are they consumed by their day-to-day whirlwind while their managers are wondering why nothing is getting done?
    • Are people speaking about problems but seldom speaking about their part in the solution?
    • Any hint of placing blame really grinds my gears. "They should get their shit together." "It can't be that hard to do X." I'd smile and remember the days I'd hop on their cathartic ride of placing blame. I struggle with helping people be aware of the impact of what they are doing. Send advice.

    For a quick idea of whether Extreme Ownership is worth your time (and we have very little time), I recommend Mike Crittenden's book notes of Extreme Summary. If you've got the time, the entire book is a recommended 5-star read.

  • Remapping keys on macOS

    I ramble a bit here - you may want to skip to how to remap keys on macOS.

    I attended WWDC for the first time ever (making lemonade in the COVID-19 situation), and after watching the keynote, got pretty excited about macOS Big Sur.

    I wanted to install the macOS Big Sur developer beta but not at the expense of making my main development MacBook Pro virtually unusable. One of the things I thought I really needed working was Karabiner-Elements, which I use to remap keys, specifically:

    • Caps Lock to Esc
    • Esc to `

    This particular remapping is really because I use ` (backtick) as my tmux prefix key. I picked this up from an ex-colleague after watching him fly while switching tmux panes. And I use either a compact 60% or 65% keyboard which meant I didn't have a dedicated ` key - I'd have to hit Fn-Esc which is even more terrible than the default of Ctrl-B.

    Photo of Escape key

    Unsurprisingly, Karabiner-Elements was not working in Big Sur. Not satisfied with that, I quickly found that macOS has supported native key remapping since macOS Sierra via the hidutil command-line tool. If you're not beyond scrappily writing some JSON and XML, this just works:

    1. Decide what keys you want to remap. In my case, I wanted to remap Caps Lock to Esc.
    2. Apple's docs say:
      The keys take a hexadecimal value that consists of 0x700000000 or’d with the desired keyboard usage value
      Pretty cryptic, but what it really means is you just have to add 0x700000000 to your key's "usage ID" in this table (techically, this is a bitwise OR, which is not addition, but the usage IDs are small enough for it to not matter).
    3. Caps Lock's usage ID is 0x39. Adding 0x700000000 to that gives 0x700000039.
    4. Esc's usage ID is 0x29 - we'll use 0x700000029.
    5. Caps Lock (0x700000039) is the source, so we will specify "HIDKeyboardModifierMappingSrc": 0x700000039.
    6. Esc (0x700000029) is the destination, so we will specify "HIDKeyboardModifierMappingDst": 0x700000029.
    7. Repeat for each pair of keys you want to remap.
    8. Try it out in the command-line:
      hidutil property --set '{"UserKeyMapping":[
        {
          "HIDKeyboardModifierMappingSrc": 0x700000039,
          "HIDKeyboardModifierMappingDst": 0x700000029
        },
        {
          "HIDKeyboardModifierMappingSrc": 0x700000029,
          "HIDKeyboardModifierMappingDst": 0x700000035
        }
      ]}'
    9. This remapping will be undone whenever you reboot your Mac, so one way to persist the remapping is to run the hidutil command every time your Mac boots. For that, we can rely on Launch Agents.
    10. Create a file named ~/Library/LaunchAgents/com.example.KeyRemapping.plist: This file basically tells macOS to run the hidutil tool when it starts up.
    11. You're all set!

    A vast improvement would be to generate the key remappings from an HTML form #ideas-are-free.

    I really love Karabiner-Elements, but my use of it has become less complex of late. There's also something to be said about running less software. And that brings me a tiny step closer to trying out Big Sur - yes, I can't take the plunge yet! You can evaluate whether you are ready after taking a look at this list of apps that are not working on macOS.

  • Installing Powerline on OS X + homebrew

    I've always wanted to get that fancy Powerline status bar and prompt. Chevrons and git branch icons in the terminal just sounds so... defying:

    Powerline screenshot

    I'd failed to get it working properly before because of a combination of outdated Powerline docs and confusion between OS X's system python/vim and homebrew's python/vim. Some of my former colleagues detailed the pains and hours lost getting Powerline setup, so I gave up.

    Anyway, I got a new Mac for work recently and decided to try again, and it was easier than I thought. You (including you, future Chu Yeow) can use this guide if you're using homebrew to install vim and python (and everything else like zsh and tmux).

    Installing Powerline on OS X

    1. Install python with homebrew: brew install python
    2. Install vim with homebrew: brew install vim --env-std --override-system-vim. You must install vim after python so that it'll compile with homebrew's python.
    3. Install powerline with pip: pip install https://github.com/Lokaltog/powerline/tarball/develop. Powerline should get installed to /usr/local/lib/python2.7/site-packages/powerline.
    4. open /usr/local/lib/python2.7/site-packages/powerline - you should see the files required for integration with zsh, vim, tmux, etc. in the bindings directory. All you need to do now is to include these bindings in your zsh, vim and tmux config files - it's that simple!
    5. Add Powerline to vim by adding these lines to ~/.vimrc:
      source /usr/local/lib/python2.7/site-packages/powerline/bindings/vim/plugin/powerline.vim
      set laststatus=2
    6. Add Powerline to tmux by adding this to ~/.tmux.conf:
      source /usr/local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf
    7. Add Powerline to zsh by adding this to ~/.zshrc:
      source /usr/local/lib/python2.7/site-packages/powerline/bindings/zsh/powerline.zsh

      If you use oh-my-zsh, be sure to source the Powerline bindings after oh-my-zsh's.

    8. Grab a patched font from https://github.com/Lokaltog/powerline-fonts (I use Inconsolata), and install it (just download, double-click the font file, and Install). If you don't use any of these fonts, you'll have to patch your favorite font yourself (have fun with that!)

    That's all you need! Go crazy and start tweaking your Powerline colorscheme.

  • Summer 2011 anime (and some from Spring 2011)

    Some of you might know that I'm a rabid anime fan. I don't talk much about it on this blog (actually, I don't talk much on this blog anymore, seeing as I haven't blogged this year). Anyway, yeah, one of my biggest passions and failings is my love for anime and I can't stop myself from collecting those cute Nendoroids too.

    This summer 2011 season, I'm watching 4 new series and 2 older series that started in spring 2011, Hanasaku Iroha and Nichijou:

    Currently watching anime, Summer 2011

    Top row: Usagi Drop, Mawaru Penguindrum, Ikoku Meiro no Croisée.
    Bottom row: No.6, Hanasaku Iroha, Nichijou.

    I'm a sucker for the slice of life genre (5 out of 6 series above are "slice of life"). Usagi Drop in particular is very promising - looking forward to how Daikichi and Rin's story unfolds. Mawaru Penguindrum is probably the winner in terms of "interestingness" though - after all, it has penguins. After the brilliant Ano Hana from spring 2011, Usagi Drop is looking to be my mainstay for this season.

    If you're an anime fan, please leave a comment on what you're watching or ping me on twitter (I'm @chuyeow) - I'd love to know what you guys like to watch when you're not coding.

  • Firefox nightly builds add a combined Stop/Go/Refresh button to the Location Bar

    In an effort to streamline Firefox's UI, the latest Firefox nightly builds have moved the Stop/Refresh button into the right corner of the Location Bar. I like this move even if the Firefox developers are simply copying design ideas from other browsers (in this case, I believe Safari was first).

    When you're typing in the Location Bar, a green Go button is shown:

    That switches to a red Stop button when the page is loading:

    The thin line you see in the location bar is a progress indicator that indicates how much of the current web page has loaded - I don't like the way it looks and I think it'll probably change in future.

    When the page has fully loaded, it changes to a Refresh button:

    This leaves a minimalist and compact toolbar:

    I should actually remove the Home button - I don't ever use it.

    To try out the new stuff coming in Firefox, download a Firefox nightly build now.

subscribe via RSS