My portable Bluetooth keyboard

I've been looking for the perfect, really portable Bluetooth keyboard for several years. Typing on the go, or having a truly mobile office in your pockets is a really interesting concept for a consultant like me. You never know when opportunity or need may arise.

A year and a half ago I ordered what it looked like the perfect keyboard for that setup, but (even though it was supposed to arrive 3-4 months later) I'm still waiting. Instead, I got this stupidly cheap (around 25 $/€/£, this is an affiliate link) keyboard. See it below, with a pound and an iPhone SE for scale

The pros:

  • Folds in half. When folded, fits, barely, a large trouser pocket if you are slim. If you are wearing a jacket you can put it in a jacket pocket.
  • Weights very little
  • Great tactile feed. Has some scissor switches that feel sharper than the (from my feeling) decently good switches in 2013's Macbook Airs. Quite pleased with it (not as good feedback as my mechanical one with brown cherries, but this weights 20 times less or so)
  • Seems to have a decently long battery life
  • Disconnects on fold, starts up on unfold. A magnetic latch keeps it closed neatly
  • Has arrow keys and F keys
  • Good range

The cons:

  • Can only be paired with one device at a time. So far this means that when I decide I want to pair it with my Mac instead of my iPhone, I need to forget the device and pair again. Not a big deal since I usually only want it for the phone or iPad, and repairing is fast
  • With a Colemak layout, the O is a small key, and a problem for me is that B is a left hand key and for me is a right hand key.
  • Alt acts like alt, no matter the operating system (you can change it with a key combination). On Mac you can tweak it, on iOS can't
  • Fn and Ctrl feel wrong as they are placed, should be swapped

Would I recommend it? Definitely. It has great feel and is a great price for quality keyboard. Oh, and this post was written all on it so I get used to the misplaced B. You can get one for Christmas from here (I'd get a few cents if you do so, thanks in advance!)

And if you want to learn Colemak I learnt using Keybr, and have had a lot of fun playing this online typing game, Z-Type. Both links are non affiliated and I have no relationship with them aside the learning or fun.
Written by Ruben Berenguel


October Kafka London Meetup - Jay Kreps: Distributed stream processing with Apache Kafka

This has been the first time I could attend the Apache Kafka meetup in London. Previous meetings had me in Barcelona or flying. First realisation: it is a surprisingly crowded meetup! Clearly, everyone is using Kafka, even if it is not clear from the outside. Oh, and the food was pretty good, too. Thanks to the sponsor (which I have sadly forgotten).

I really enjoyed this one. The speaker was Jay Kreps, CEO and co-founder of Confluent (and author of I Heart Logs), so, basically, a Kafka top committer himself. He delivered the same presentation he gave in Reactive Summit 2016, but since I wasn't in the former I could enjoy it this time. It was a hand-drawn presentation (I suspect using Paper for iOS), hitting all the supposedly good points of technical presentations (short slides, don't read them, etc). It was also quite deep, explaining what/how and why we should use Kafka Streams for our real-time data pipelines.

Jay, presenting. This architecture needs some Kafka
The key takeaway is that if you are already using Kafka as your real-time data hose-and-bucket, you can reuse this cluster (and all its goodies: partitions, groups, offsets) for processing the data as it comes, withouth needing an additional framework (Flink, Spark, Storm... you know the tune). Also, if you'drather write Perl than Java and this is preventing you from using the KStreams API, behold! Even if they don't have an official Scala API, wrapping it is extremely easy.

You can view (and download) the slides from here, and watch Jay in video from Reactive Summit here.
Written by Ruben Berenguel


More emacs configuration tweaks (multiple-cursor on click, minimap, code folding, ensime eval overlays)

At Affectv we use a wide range of editors: Sublime, Atom, Emacs, Pycharm, IntelliJ... Actually only two people use the same editor! As such, from time to time I see things in other people's editors that I would like to have as well. So, yesterday I decided to improve on some configuration settings on Spacemacs.

Click for multiple-cursors

I saw this on Jordi's Sublime, and it is much more comfortable than using more-like-this or similar helper functions, even if I need to use the trackpad to do so. After all, a multi-cursor edit (proper edit, not as a substitute for a macro) is rare enough that I can tolerate leaving the home row. Easy enough to configure thanks to Magnar Sveen.

(global-unset-key (kbd "M-<down-mouse-1>"))
(global-set-key (kbd "M-<mouse-1>") 'mc/add-cursor-on-click)


Also from Sublime, I had this on my old emacs setup. As simple as adding minimap to the list of additional packages and configuring its property group. See animation below.

dotspacemacs-additional-packages '(helm-dash key-chord pig-mode mmm-mode minimap origami ansible)


I have always loved how clean vim's folding works, and how Sublime has this nice folding. Then I found origami-mode and my emacs-life was complete. I tweaked a little the folding functions so that minimap was updated on fold (for some reason it is not, I guess minimap is tied to the "modified" hook or similar). I bound z and Z (and A-z which maps to æ in Colemak) to the basic fold operations.

(eval-after-load 'origami
       (defun rb-show-only (buffer point)
         (interactive (list (current-buffer) (point)))
         (progn (origami-show-only-node buffer point)

       (defun rb-toggle-rec (buffer point)
         (interactive (list (current-buffer) (point)))
         (progn (origami-recursively-toggle-node buffer point)

       (define-key evil-normal-state-map "æ" 'rb-show-only)
       (define-key evil-normal-state-map "Z" 'origami-toggle-node)
       (define-key evil-visual-state-map "Z" 'origami-toggle-node)
       (define-key evil-insert-state-map "C-Z" 'origami-toggle-node)
       (define-key evil-normal-state-map "z" 'rb-toggle-rec)
       (define-key evil-visual-state-map "z" 'rb-toggle-rec)
       (define-key evil-insert-state-map "C-z" 'rb-toggle-rec)

For some reason just advising the functions with after didn't work, this is not great but does work. I left the Z bindings as they are, since I have not used them yet, and will probably delete them if I keep not using them.

Execution overlays in Ensime (Scala)

I saw this for Cider in the emacs church meeting from August, and heard @fommil (I think it was him) mention that it was coming to ensime. And indeed it was. And it's easy enough to use C-c C-v C-r (thing of it as extended command, eval, region to remember), given an open inferior Scala interpreter. Symbol prettify does not apply to overlays, so you need to customise the arrow used therein.

Written by Ruben Berenguel