twitter github linkedin email

Álvaro Ramírez

[2015-11-29 Sun] # Leading bookmarks

[2015-11-29 Sun] # Online reading backlog

[2015-11-29 Sun] # Travel apps bookmarks

[2015-11-28 Sat] # Travel lifestyle bookmarks

[2015-11-26 Thu] # SQLite bookmarks

[2015-11-26 Thu] # Unix/Linux tools bookmarks

[2015-11-26 Thu] # Couchbase React Native bookmarks

[2015-11-26 Thu] # Installing Emacs 25 devel on Mac OS X


brew update
brew install emacs --HEAD --with-cocoa --with-gnutls


brew update
brew install emacs --devel --with-cocoa --with-gnutls

Had problems loading seq. Removed byte-compiled packages:

$ find ~/.emacs.d/elpa -iname *.elc -exec rm '{}' \;

[2015-11-25 Wed] # Diagram tools bookmarks

[2015-11-24 Tue] # Licensing bookmarks

[2015-11-22 Sun] # Backup bookmarks

[2015-11-22 Sun] # Making hummus

[2015-11-22 Sun] # Nara travel bookmarks

[2015-11-21 Sat] # Docker bookmarks

[2015-11-21 Sat] # Angular bookmarks

[2015-11-21 Sat] # Mac OS bookmarks

[2015-11-21 Sat] # easy_install->pip->conda

Spotted Conda package manager. It handles python installations, in addition to package management. There's also a package index provided by Binstar. Installed Miniconda, the bare bones Conda environment.

Can't find a python package in Binstar? Here's a post on Using PyPi Packages with Conda. If that fails, you can try pip from your Conda python environment.

[2015-11-16 Mon] # Traditional music bookmarks

[2015-11-04 Wed] # Recover from an unresponsive Emacs

Wilfred Hughes has a handy tip to bail you out of a hung Emacs instance:

pkill -SIGUSR2 emacs

ps. Not had a chance to try it, but next time it happens…

[2015-10-25 Sun] # Training for under 50 min 10k run

Not much training time for an under 50 minute 10k run, but here's an attempt (based on time-to-run's sub-50):

Mon Tue Wed Thu Fri Sat Sun
Oct 26 Oct 27 Oct 28 Oct 29 Oct 30 Oct 31 Nov 1
    60 min 30 min 2k @ 4.55/k rest 105 min
        2 min rest    
      (repeat x 3)    
Nov 2 Nov 3 Nov 4 Nov 5 Nov 6 Nov 7 Nov 8
30 min 30 min 1k @ 4.50/k 30 min 30 min rest 5k @ 4.55/k
    90 sec rest        
    (repeat x 5)        
Nov 9 Nov 10 Nov 11 Nov 12 Nov 13 Nov 14 Nov 15
10k easy 30 min 1k @ 4.55/k 30 min 30 min rest race day
    1 min easy        
    (repeat x 3)        

[2015-10-25 Sun] # Reading a running training plan

A sample from Kona Part 2's comments:

2.5 w/u to 4x(1.25@11.5 w/0.25R@7) to 3x(3.75@10.5 w/0.5R@7) to 2.5 c/d.

Is read from left to right as:

2.5 mile warm up to four times through 1.25 miles at 11.5 miles per hour with 0.25 miles recovery at 7 miles per hour to three times through 3.75 miles at 10.5 miles per hour with 0.5 miles recovery at 7 miles per hour to 2.5 miles cool down.

[2015-10-23 Fri] # Find binary in PATH using python

import distutils.spawn
print distutils.spawn.find_executable('git')

[2015-10-22 Thu] # Indonesia travel bookmarks

[2015-10-22 Thu] # Mongolia travel bookmarks

[2015-10-22 Thu] # Running bookmarks

[2015-10-22 Thu] # Media player bookmarks

[2015-10-16 Fri] # UX toolbox bookmarks

[2015-10-08 Thu] # Change Emacs shell's CWD with helm projectile

If using Emacs shell and helm projectile, you can wire these up to quickly change your current working directory.


(require 'helm-projectile)

(defun ar/shell-cd (dir-path)
"Like shell-pop--cd-to-cwd-shell, but without recentering."
  (unless (string-equal mode-name "Shell")
    (error "Not in Shell mode"))
  (message mode-name)
  (goto-char (point-max))
  (insert (concat "cd " (shell-quote-argument dir-path)))
  (let ((comint-process-echoes t))

(defun ar/helm-projectile-shell-cd ()
  "Change shell current working directory using helm projectile."
  (unless (string-equal mode-name "Shell")
    (error "Not in Shell mode"))
  (let ((helm-dir-source (copy-tree  helm-source-projectile-directories-list)))
    (add-to-list 'helm-dir-source '(action . ar/shell-cd))
    (add-to-list 'helm-dir-source '(keymap . nil))
    (add-to-list 'helm-dir-source '(header-line . "cd to directory..."))
    (helm :sources helm-dir-source
          :buffer "*helm-dirs*"
          :candidate-number-limit 10000)))

[2015-10-07 Wed] # Thermostat reset on Bosch WKD28350GB

My Bosch washer/dryer (WKD28350GB) stopped drying recently. Resetting the dryer's thermostat red breaker did the trick.

WKD28350GB-01.jpg WKD28350GB-02.jpg WKD28350GB-03.jpg WKD28350GB-04.jpg

[2015-10-05 Mon] # Javascript fetch node sample

Playing with node and fetch:

// Requisite: npm install node-fetch --save
// Save to fetch-demo.js
// Run: node fetch-demo.js

var fetch = require('node-fetch');

fetch("", {
  method: 'GET',
  timeout: 5000
}).then(function(response) {
  return response.json();
}).then(function(response) {
  console.log('subject: ' + response.subject);
  console.log('body: ' + response.body);
}).catch(function(reason) {

[2015-10-01 Thu] # Extract dominant colors in images

There's a handy HN post pointing to Javier López's Using imagemagick, awk and kmeans to find dominant colors in images. A comment also highlights color-extract, written in Go.

[2015-09-28 Mon] # Find a word with regex and WordNet

Recently wanted to come up with a random keyword. Querying WordNet and a regular expression did the job.

Installed WordNet on Mac:

$ brew install wordnet

Want a word ending in "esome"?

$ wn esome -grepn -grepv -grepa -grepr | egrep -o -e "\w*esome\b" | sort | uniq


[2015-09-26 Sat] # Soundcloud's Go best practices (GopherCon 2014)

Having watched the video, some takeaways:



Repo structure

  • Makefile
  • main.go
  • support.go
  • foo
    • foo.go
    • bar.go
  • whatever-server
    • main.go
  • wharever-worker
    • main.go

Formatting and style

Use gofmt.

Google's codereview guidelines.

Avoid named return parameters.

Avoid make and new (unless you know sizes).

Use struct{} for sentinel values: sets, signal chans.

  • Conveys no information in it this part.
  • Instead of empty interface.
  • instead of boolean.

Break long lines at parameters

  • No need to compact.
  • Keep trailing coma in last argument.


func main() {
  var (
    foo = flags.String("foo", "doch", "...")
    bar = flat.Int("bar", 34, "...")
  // ...


  • package log
  • Telemetry
  • Push model (gets expensive over time)
    • Graphite
    • Statsd
    • AirBrake
  • Pull model (chosen)
    • expvar
    • Prometheus


  • package testing
    • Unit tests
    • reflect.DeepEqual
  • Integration
    • Use flags for starting services
    • // +build integration

Code validation

  • On Save
    • Go fmt
    • Go import (go fmt++)
  • On Build
    • Go vet
    • Golint
    • Go test
  • On Deploy
    • go test -tags=integration
  • GoCov?

Dependency management

  • Unimportant projects
    • go get -d (and hope)
  • Important
    • VENDOR (ie. copy into your repo)
      • Git submodules (no!).
      • Git subtrees (seem OK).
      • Tool (godep?).
      • Build
        • For binaries (use _vendor subdir)

[2015-09-23 Wed] # Sync pip with Mac OS updates

My pip installation recently broke after a Mac OS update.

$ pip
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/", line 2793, in <module>
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/", line 673, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/", line 576, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==1.1

Updating my pip installation fixes the break:

$ sudo easy_install -U pip

[2015-09-20 Sun] # Chinatown treats review

Recommended? yep

There's a corner in Chinatown hosting some truly superb treats. If you get caught in the rush between Newport court and Newport place, you'd likely fail to notice some the awesome street food stands.

chinatown.jpg newport-court.jpg

Chilly squid

I've walked past this place many times and never noticed it. They serve a handful of items, but the grilled chilly squid skewers caught my attention. They're grilled, brushed with chilly sauce and finished with sprinkled sesame and cumin seeds. Super tasty.


chilly-squid-1.jpg chilly-squid-2.jpg

Pancake + Crisp + Egg + Hot chillies = Jiān Bǐng 煎餅

I first had these delicious breakfast savory pancakes at a Beijing street food stall. Never expected to randomly find Jiān Bǐng in London. It's a crepe with an additional egg spread, hoisin sauce, chilly sauce, hot chillies, topped with spring onions and coriander, all wrapping a wonderfully crispy bread cracker. And.. it's awesome.


Tai Yaki

Chinatown Bakery is hard to miss. Pedestrian traffic slows down as we all fall under the spell of the Tai Yaki machine. This wonderful assembly line produces fish-shaped sweet waffles filled with custard. They are the perfect dessert after some savory street snacks. You can get a bag of 4 for £2.

fish-1.jpg fish-4.jpg

All near each other

All these delights are within a stone's throw away from each other.



Was this post useful to you? do reply!

Better suggestion?

London is full of overhyped, gimmicky, and unnecessarily expensive restaurants. Very few deliver truly awesome food (even those expensive ones). Got suggestions? I'd love to hear from you @xenodium.

[2015-09-18 Fri] # React bookmarks

[2015-11-29 Sun] updated

[2015-09-16 Wed] # Chinese rice vinegar

Note to self to buy Gold Plum Chinkiang Vinegar. Awesome with dim sum.


[2015-09-13 Sun] # Use ImageMagick to batch-resize images

Using percentage:

$ mogrify -resize 10% *.png

Using dimensions:

$ mogrify -resize 120x120 *.png

Lots of other alternatives from ImageMagick's documentation:

-resize scale%
-resize scale-x%xscale-y%
-resize width
-resize xheight
-resize widthxheight
-resize widthxheight^
-resize widthxheight!
-resize widthxheight>
-resize widthxheight<
-resize area@

[2015-09-08 Tue] # Lucky 7 review

Recommended? yep

Lucky 7 is a small nostalgic American diner on Westbourne Park road. I like the vibe, the space, and the unpretentious waiting staff. I go to Lucky 7 often enough, originally for the buttermilk pancakes, but the list of favorites on the menu keeps growing.

lucky-7-menu-board.jpg lucky-7-staff.jpg

Smileys by w.dyer.

Buttermilk Banana pancakes

These are my favorite pancakes in London by far. Banana buttermilk pancakes and a few free coffee refills usually sort me out until dinner time. Add a side of bacon if extra hungry. You probably don't need it though.

lucky-7-coffee.jpg lucky-7-pancakes.jpg

Reuben sandwich

The reuben has been on Lucky 7's specials menu for months now. Not had many of these in London, but compared to The Brass Rail's, this reuben was a clear winner. The sandwich is huge and comes with fries. My girlfriend and I struggled to finish one between the two of us.



Vanilla milkshake (add malt!)

This milkshake hits the spot every time, but it's filling. You almost have to decide between the shake and an actual meal. If you must have it, add malt. Sorry, no picture.

Huevos Rancheros

This is a breakfast dish I can equally make (better?) at home, but Lucky 7 wins hands down every time I'm feeling particularly lazy. Sorry, no picture.


Was this post useful to you? do reply!

Better suggestion?

London is full of overhyped, gimmicky, and unnecessarily expensive restaurants. Very few deliver truly awesome food (even those expensive ones). Got suggestions? I'd love to hear from you @xenodium.

[2015-09-02 Wed] # Sierra Leone travel bookmarks

[2015-09-02 Wed] # London travel bookmarks

[2015-08-23 Sun] # Use ImageMagick to auto-orient images

Recently needed to rotate images based on EXIF metadata. ImageMagick to the rescue:

$ for i in *.png; do convert -auto-orient "$i" "$i"; done

[2015-08-23 Sun] # Bengali Macher Jhol

My friend Sakhya brought me the wonderful Cookbook of Regional Cuisines of India. After improvisations and substitutions, here's my attempt at making Bengali Machcher Jhol:

bengali-machcher-jhol-00.png bengali-machcher-jhol-01.png bengali-machcher-jhol-02.png bengali-machcher-jhol-03.png bengali-machcher-jhol-04.png bengali-machcher-jhol-05.png

[2015-08-22 Sat] # New habits for 2015

  • 20 min morning meditations.
  • A better way to tie your shoes.
  • Cold showers (all of them!).
  • Keys, wallet, phone, badge, and headphones live together.
  • Listen to audio books.
  • Morning runs.
  • Nightly flossing.

[2015-08-22 Sat] # Meditation retreats bookmarks

[2015-08-22 Sat] # Meditation bookmarks

[2015-08-22 Sat] # Learning bookmarks

[2015-08-22 Sat] # Bundi travel bookmarks

  • Bundi Haveli (accomodation).
  • Hadoti Palace (accomodation).
  • Haveli Braj Bhushan Ji ki (accomodation).
  • Haveli Katkoun Guest House (accomodation).
  • Kasera Paradise (accomodation).

[2015-08-14 Fri] # Upgrading PL30 headphones

I've loved my Soundmagic PL30 in-ear headphones. They're relatively inexpensive, comfortable, and great for exercising (they stay in). Audio quality and bass have been good enough (I don't need much). Unfortunately, I've had two pairs of PL30's and both stopped working after a year or two. I'm replacing the last pair with RHA's MA750 (an upgrade, me hopes).

Other contenders considered: Etymotic Research HF5, and Shure SE215. Also considered bluetooth alternatives like JayBird BlueBuds X and Plantronics BackBeat GO 2.

I'm somewhat nervous to pay more for a pair of headphones. Let's hope they don't meet the same unfortunate fate. We'll see.

[2015-08-13 Thu] # Quotes

[2015-08-13 Thu] # Bhutan travel bookmarks

[2015-08-12 Wed] # Cooking bookmarks

[2015-08-11 Tue] # 9 week half-marathon training

While reading Zen Habits: Mastering the Art of Change, I comitted to running half marathon in mid-October. That's roughly two months from now. Here's a 9 week training schedule:

1 Rest 5 Km 5 Km Cycle Rest 5 Km 7 Km
2 Rest 5 Km 5 Km Cycle Rest 5 Km 8 Km
3 Rest 7 Km 5 Km Cycle Rest 5 Km 10 Km
4 Rest 8 Km 5 Km Cycle Rest 5 Km 12 Km
5 Rest 8 Km Rest 8 Km Rest 5 Km 14 Km
6 Rest 8 Km Rest 8 Km Rest 6 Km 16 Km
7 Rest 8 Km 8 Km 8 Km Rest 8 Km 19 Km
8 Rest 8 Km Rest 12 Km Rest 8 Km 16 Km
9 Rest 8 Km Rest 5 Km 5 Km Rest Race

My times:

1 Rest 29:04 Rest 26:36 38:40
2 Rest 29:11 28:50 Rest 27:07 44:55
3 Rest 40:46 26:29 Rest 57:01
4 Rest 46:46 Rest 30:08 1:12:10
5 Rest 46:59 Rest 44:46 Rest 24:50 1:25:24
6 Rest 50:02 Rest 46:24 Rest 1:37:39
7 Rest 46:54 46:41 46:42 Rest 1:57:57
8 Rest 45:28 Rest 48:13 (8km) Rest 43:56
9 Rest 44:24 Rest 27:12 26:09 Rest 1:58:28

[2015-08-11 Tue] # Shanghai travel bookmarks

[2015-11-29 Sun] updated

[2015-08-10 Mon] # Singapore job board bookmarks

[2015-08-08 Sat] # Germany travel bookmarks

[2015-08-08 Sat] # Menorca travel bookmarks

[2015-08-08 Sat] # Travel essentials

[2015-08-08 Sat] # Philippines travel bookmarks

[2015-07-23 Thu] # Add site-specific browsers to your workflow

There are three browser tabs continously used in my workflow: GMail, Google Calendar, and Google Play Music. I normally have many more tabs open, but these three I access periodically. As the number of open tabs increases, and I fail to cleanup, getting back to my usual three gets a little trickier.

So far, I've kept each of these services open in separate windows. But that doesn't always work. Click on any link in your inbox and you're back to playing cleanup. This is where site-specific browsers (SSB) can help.

Epichrome enables you to build Chrome-based SSBs (on Mac OSX). Build an SSB for the usual suspects and easily jump to them using the app switcher.


[2015-07-22 Wed] # iOS camera bookmarks

[2015-07-20 Mon] # Sardinia travel bookmarks

  • Alghero.
  • Baja Sardinia.
  • Budoni.
  • Cala Goloritze, Sardinia.
  • Castelsardo (gifts maybe?).
  • Food: Maialetto sardo (Pig), Sebadas, Pardula, Papassinas, Pani e sapa.
  • L'Asinara boat trip (abandoned penitentiary).
  • La Pelosa beach.
  • Nuraghe.
  • Porto Cervo.
  • Porto Torres.
  • San Teodoro.
  • Stintino (fishing port).
  • Zedda e Piras vinyards (Alghero).

[2015-07-17 Fri] # Open closest build file in Emacs

Whether it's Makefile, SConstruct, BUILD, or your favorite build file, chances are you have to tweak it from time to time. ar/open-build-file searches your current and parent directories to find a build file.

(defvar ar/project-file-names '("Makefile" "SConstruct" "BUILD"))

(defun ar/parent-directory (path)
  "Get parent directory for PATH."
  (unless (equal "/" path)
    (file-name-directory (directory-file-name path))))

(defun ar/find-upwards (path filename)
  "Search upwards from PATH for a file named FILENAME."
  (let ((file (concat path filename))
        (parent (ar/parent-directory (expand-file-name path))))
    (if (file-exists-p file)
      (when parent
        (ar/find-upwards parent filename)))))

(defun ar/open-closest (filename)
  "Open the closest FILENAME in current or parent dirs (handy for finding Makefiles)."
  (let ((closest-file-path (ar/find-upwards (buffer-file-name)
    (when closest-file-path
      (message closest-file-path)
      (switch-to-buffer (find-file-noselect closest-file-path)))

(defun ar/open-build-file ()
  "Open the closest project file in current or parent directory.
For example: Makefile, SConstruct, BUILD, etc.
Append `ar/project-file-names' to search for other file names."
  (catch 'found
    (mapc (lambda (filename)
            (when (ar/open-closest filename)
              (throw 'found t)))
    (error "No project file found")))

[2015-07-15 Wed] # Create iOS static fat libraries

Have separate static libraries for different iOS architectures? Stitch 'em up into a single fat library using with lipo:

$ lipo -create libOne_i386.a libOne_x86_64.a libOne_armv7.a libOne_arm64.a -output libOne.a

[2015-07-15 Wed] # Settling scores with an org table

Recently kept track of expenses between a group of us. To settle the scores, I emailed an exported HTML table from an org file. This was simple enough and required no external viewer from recepients. The org table, in all its textful glory, looked as follows…

| Date             | Item           |   Charge |
| [2015-06-18 Thu] | Cash           |    20.00 |
| [2015-07-11 Sat] | Lucky 7        |    42.97 |
| [2015-07-13 Mon] | Santa Maria    |    32.00 |
| [2015-07-12 Sun] | Tayyabs        |    46.00 |
| [2015-07-13 Mon] | The Brass Rail |    39.00 |
| [2015-07-13 Mon] | Underground    |    10.00 |
| [2015-07-10 Fri] | Cash           |    20.00 |
| [2015-07-13 Mon] | Cash           |    20.00 |
| [2015-07-14 Tue] | Cash           |    20.00 |
|                  | total          | £ 249.97 |
#+TBLFM: @11$3=vsum(@2..@10);£ %.2f

…while the exported HTML below could be easily pasted on to an email.

Date Item Charge
[2015-06-18 Thu] Cash 20.00
[2015-07-11 Sat] Lucky 7 42.97
[2015-07-13 Mon] Santa Maria 32.00
[2015-07-12 Sun] Tayyabs 46.00
[2015-07-13 Mon] The Brass Rail 39.00
[2015-07-13 Mon] Underground 10.00
[2015-07-10 Fri] Cash 20.00
[2015-07-13 Mon] Cash 20.00
[2015-07-14 Tue] Cash 20.00
  total £ 249.97

[2015-07-13 Mon] # Recognize new password prompts in Emacs shell

At some point, you may come across a trusted command-line utility prompting you for a password, and Emacs shell happily displaying each typed character to the nearby-world to see. Luckily, you can train Emacs to recognize new password prompts and hide the typed characters in modes deriving from comint. Append the password prompt REGEXP:

(setq comint-password-prompt-regexp (concat comint-password-prompt-regexp
                                            "Password for red alert:"))

[2015-07-11 Sat] # Bosnia and Hercegovina travel bookmarks

[2015-07-11 Sat] # Ireland travel bookmarks

[2015-07-09 Thu] # Pizza in London

Not tried these yet. Taking note:

  • Bravi Ragazzi (Streatham).
  • Homeslice (Covent Garden).
  • Lord Morpeth (Hackney).
  • Santa Maria (Ealing).
  • Voodoo Ray's (Dalston).
  • Well Kneaded Wagon (Date-dependent location).

[2015-07-09 Thu] # mp4 to gif

Converting mp4 to gif is handy for posting short screencasts. You can convert to gif using ffmpeg and optimize with imagemagick. To install:

apt-get install ffmpeg imagemagick (linux)
brew install ffmpeg imagemagick (Mac)

Convert to gif:

ffmpeg -i my.mp4 -pix_fmt rgb24 -r 5 my.gif

Optimize with:

convert -dither none -layers Optimize my.gif my_optimized.gif

UPDATE: There's also licecap and subsequently optimize with:

cat source.gif | gifsicle --colors 256 --optimize=3 --delay=15 > target.gif

[2015-07-06 Mon] # Keyboards bookmarks

[2015-07-05 Sun] # United States travel bookmarks

[2015-07-05 Sun] # Lebanon travel bookmarks

[2015-07-05 Sun] # Slovenia travel bookmarks

[2015-07-05 Sun] # Belgium travel bookmarks

[2015-07-03 Fri] # Fishing with Emacs

OK not quite, but having recently learned about C-M-w (append-next-kill), I used it in a keyboard macro to fish out matching lines. This is similar to flush-lines, except the kill ring is also populated. This is handy, if you need the flushed lines. Here's an example.


Here's the equivalent in Emacs lisp:

(defun flush-kill-lines (regex)
  "Flush lines matching REGEX and append to kill ring.  Restrict to \
region if active."
  (interactive "sFlush kill regex: ")
      (when (use-region-p)
        (narrow-to-region (point) (mark))
        (goto-char 0))
      (while (search-forward-regexp regex nil t)
        (move-beginning-of-line nil)

[2015-07-03 Fri] # California travel bookmarks

[2015-07-01 Wed] # Rebind caps lock to control key on Mac OS X

Let's see if this one sticks. I'll give caps lock as control a try. Rebinding the keys on Mac OS X is easy enough: caps-lock-to-control.png

System Preferences -> Keyboard -> Keyboard Tab -> Modifier Keys…

[2015-06-30 Tue] # Searchable ebooks in Emacs

If you haven't bought Mastering Emacs by Mickey Petersen, you should. It's a wonderful source of Emacs tips. Having just finished the ebook on my Kindle, I was keen to go back and fish out some of that newly found wisdom. My immediate reaction was to figure out a way to make the ebook searchable from Emacs.

The ebook is available in epub and pdf format. Though Emacs's docview is super handy for viewing pdf's, searching didn't feel as comfortable as searching in org mode. The epub, on the other hand, proved useful. Pandoc can easily convert from epub to org.

pandoc  --from=epub --to=org mastering-emacs.epub >

After a some tidying (mostly removing BEGIN_HTML/END_HTML blocks and adding TITLE/AUTHOR), the resulting org file is surprisingly clean and easy to search/navigate. helm-swoop and helm-org-in-buffer-headings are great for that. mastering-emacs-org-00.png mastering-emacs-org-01.png mastering-emacs-org-02.png

[2015-06-21 Sun] # Portugal travel bookmarks

[2015-07-05 Sun] updated
  • Avenida dos Platanos.
  • Azores islands.
  • Boca do inferno.
  • Cabo da Roca.
  • Casa dos passarinhos (Steak on hot stone, tuna steak with “mirandesa” sauce, monkfish masada).
  • Cascais - Guincho.
  • Cervejaria Ramiro (seafood restaurant in town).
  • Eduard 7th park.
  • Estoril.
  • Fox Trot (bar).
  • Jeronimos Monastery (Lisbon).
  • Lisbon Castle.
  • Mouro's castle (Sintra).
  • Mouro's castle.
  • Pasteis de Belem (Lisbon).
  • Pastelaria piriquita eat queijadas de sintra.
  • Pasteleria Piriquita (Sintra).
  • Pavilhao Chines (bar).
  • Pena's Pallace (must see if you go to sintra)
  • Pena's Pallace (Sintra).
  • Pensao do Amor (bar).
  • Praça do comercio.
  • Quinta da Regaleira
  • Quinta da Regaleira (Sintra).
  • Sintra village
  • Sintra.
  • Stop do bairro (tamboril rice, prawn curry, and seafood rice).
  • Sé (Lisbon Cathedral).
  • The best beaches in Portugal's Algarve.
  • This other Eden: the Azores, Europe's secret islands of adventure.
  • Torre Belem (Lisbon).

[2015-06-21 Sun] # Bulgaria travel bookmarks

[2015-06-21 Sun] updated

[2015-06-21 Sun] # Presenting bookmarks

[2015-06-21 Sun] # Bali travel bookmarks

  • Pura Lempuyang, Bali.

[2015-06-17 Wed] # WWDC app for OS X

Guilherme Rambo created a great OS X OS X app for viewing WWDC content. Just installed it. Super handy. Thanks. Installing as simple as:

$ brew cask install wwdc

[2015-06-15 Mon] # Debugging Objective-C reference cycles

Overriding retain/release/autorelease may be handy while debugging:

- (instancetype)retain {
  NSLog(@"%p, retain", self);
  return [super retain];

- (oneway void)release {
  NSLog(@"%p, release", self);
  [super release];

- (instancetype)autorelease {
  NSLog(@"%p, autorelease", self);
  return [super autorelease];

[2015-06-13 Sat] # London grub

Beyond the hype, buzz, and pricey gimmicks… Places to eat in London:

  • Antipode.
  • Arang.
  • Bone Daddies.
  • Gelupo.
  • Grind.
  • Holy Cow.
  • Kerbisher and Malt.
  • Kulu Kulu (South Ken).
  • Le Relais de Venise.
  • Lucky 7's.
  • Royal China.
  • Shree Krishna Vada Pav.
  • Sri Suwoon.
  • Tayyabs.
  • The Cow.
  • Tonkotsu.

[2015-06-08 Mon] # My working playlist

[2015-06-02 Tue] # Xcode bookmarks

[2015-06-02 Tue] # Costa Rica travel bookmarks

[2015-06-02 Tue] # Australia travel bookmarks

[2015-06-02 Tue] # Samoa travel bookmarks

[2015-06-02 Tue] # Norway travel bookmarks

[2015-06-02 Tue] # Los Angeles travel bookmarks

[2015-05-28 Thu] # Mastering Emacs is out

Emacs is amazingly alive. New packages are regularly listed on melpa and a new book just came out: Mastering Emacs by Mickey Petersen.


[2015-05-25 Mon] # South Carolina travel bookmarks

[2015-05-25 Mon] # Colorado travel bookmarks

[2015-05-25 Mon] # Bash bookmarks

[2015-05-25 Mon] # restclient.el

Installed Pashky's restclient.el Emacs package. Super helpful when trying out REST APIs.


[2015-05-25 Mon] # Seatle travel bookmarks

[2015-05-25 Mon] # Berlin travel bookmarks

[2015-05-25 Mon] # Skeuomorph

From Wikipedia, skeuomorph ˈskjuːəmɔrf is a derivative object that retains ornamental design cues from structures that were necessary in the original. Examples include pottery embellished with imitation rivets reminiscent of similar pots made of metal and a software calendar that imitates the appearance of binding on a paper desk calendar.

[2015-05-25 Mon] # define-word

Installed Abo Abo's define-word Emacs package. A handy package to define words at point.


[2015-05-22 Fri] # Flushing empty lines in Emacs

Via, removing blank lines in a buffer:

M-x flush-lines RET ^$ RET

[2015-05-22 Fri] # Regex bookmarks

[2015-05-06 Wed] # Write to temp iOS snippet

NSString *tempDir = NSTemporaryDirectory();
NSLog(@"%@", tempDir);
NSString *dataFilePath = [tempDir stringByAppendingPathComponent:@"my.file"];
[data writeToFile:dataFilePath atomically:YES];

[2015-05-04 Mon] # Greece travel bookmarks

[2015-05-04 Mon] # Sri Lanka travel bookmarks

[2015-05-04 Mon] # Switzerland travel bookmarks

[2015-05-04 Mon] # Thailand travel bookmarks

[2015-05-04 Mon] # Madagascar travel bookmarks

[2015-05-04 Mon] # Hong Kong travel bookmarks

[2015-05-04 Mon] # Barcelona travel bookmarks

[2015-08-26 Wed] updated

[2015-05-04 Mon] # Iceland travel bookmarks

[2015-04-30 Thu] # Building clang-format

Based on instructions from Building clang-format and friends on OSX Mountain Lion.

set -o nounset
set -o errexit

# Based on instructions from:

readonly LLVM_DIR_PATH='/tmp/llvm'

update_repo() {
  if [[ ! -d $1 ]]; then
    git clone $2
    cd $1
    git pull
    cd ..
  cd ..

update_all_repos() {
  update_repo "llvm" ""
  pushd "${LLVM_DIR_PATH}/llvm/tools"
  update_repo "clang" ""
  cd "../../${LLVM_DIR_PATH}/llvm/tools/clang/tools"
  update_repo "clang-tools-extra" ""
  cd "../../.."

build_clang() {
  mkdir -p clang
  mkdir -p build
  cd clang
  ../llvm/configure --enable-libcpp --enable-cxx11 --enable-debug-symbols=no --enable-optimized --prefix="${LLVM_DIR_PATH}/build"
  make install

mkdir -p $LLVM_DIR_PATH

Bonus: use clang-format-configurator.

[2015-10-16 Fri] # iOS Auto Layout bookmarks

[2015-04-30 Thu] # Programmatic iOS Auto Layout

Basic iOS auto layout usage. See Adopting Auto Layout and Visual Format language for reference.

- (instancetype)initWithFrame:(CGRect)frame {
  self = [super initWithFrame:frame];
  if (self) {
    // Disable autoresizing mask translation for parent.
    self.translatesAutoresizingMaskIntoConstraints = NO;

    _subview1 = [[UIView alloc] init];
    // Disable autoresizing mask translation for subview.
    _subview1.translatesAutoresizingMaskIntoConstraints = NO;

    _subview1.backgroundColor = [UIColor redColor];
    [self addSubview:_subview1];

    // Creates a dictionary of bindings to be used in visual format.
    NSDictionary *viewBindings = NSDictionaryOfVariableBindings(_subview1);

    // H: horizontal layout
    // |-50- spacing in relation to superview
    // [_subview1(==50)] subview1's width
    [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-50-[_subview1(==50)]"
    [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[_subview1(==50)]"
  return self;

[2015-04-23 Thu] # Japan travel bookmarks

[2015-10-21 Wed] # Kyoto travel bookmarks

[2015-11-22 Sun] updated

[2015-04-19 Sun] # Tokyo travel bookmarks

[2015-11-22 Sun] updated
  • Akihabara: Electronics district, arcades and comic stores.
  • Asakusa hotel.
  • Asakusa Shrine: Shinto shrine and market.
  • Bar Epilogue.
  • Bar Odin.
  • Fish market (6am sushi).
  • Ghibli museum (book in advance or try lawson).
  • Ginza.
  • Golden Gai (lots tiny bars).
  • Hazelburn.
  • Imperial Palace: Book to go inside. Beautiful park, great for pictures.
  • Mori Art museum.
  • Nezu museum.
  • Omoide yokocho: Alleyway next to Shinjuku station. Lots of yakitori restaurants.
  • Omotesando Koffee (coffee and baked custard slice).
  • Omotesando side streets.
  • Roppongi.
  • Shibuya Crossing: Largest pedestrian crossing in the world.
  • Shimokitazawa (thirft stores, music bands, pubs, and cafes).
  • Takaosan (Mount Takao).
  • Tokyo Municipal Government building: Only for observation deck with view to Fuji (if clear day).
  • Tokyo station: Friendly JR office (english spoken). They help book all trips/tickets/reservations.
  • Tokyo Station: Massive station. Lots of restaurants and shops (check out ramen street).
  • Tokyu Hands and Loft (shops in Shibuya).
  • Toritake (yakitori at Shibuya).
  • Tsukiji Fish Market: Sushi bars and food vendors (get there early, visitor numbers restricted).
  • Viron Bakery (in Shibuya).
  • 婁熊東京 (raw and grilled pork).
  • 酒友 (Sake & good Shabushabu), Roppongi.

[2015-04-19 Sun] # UK travel bookmarks

[2015-04-19 Sun] # Development quotes

[2015-04-19 Sun] # Spain travel bookmarks

[2015-04-19 Sun] # Meet up bookmarks

[2015-04-17 Fri] # Plantuml example

Played with Plantuml. Convenient for generating UML diagrams from text. Here's the Language Reference Guide. Here's an example:

  abstract class Singer {
    abstract void sing()
    void Dance()

  skinparam monochrome true
  Singer <|-- PopSinger
  Singer <|-- SalsaSinger

  class PopSinger {
    void sing()

  class SalsaSinger {
    void sing()


Install plantuml on Mac OS X:

brew install plantum

Generating diagram:

$GRAPHVIZ_DOT=~/homebrew/bin/dot java -jar path/to/plantuml.8018.jar diagram.plantuml

[2015-04-14 Tue] # Helm-describe-helm-attribute

Writing A Spotify Client in 16 Minutes is fantastic for picking up helm and Emacs lisp tips. Of interest helm-describe-helm-attribute, second to the awesomeness of helm-spotify integration.

[2015-04-12 Sun] # Youtube videos in your org html export

Sacha Chua and John Wiegley posted a wonderful video on Emacs lisp development tips. Embedding the following raw HTML using #+BEGIN_HTML/#+END_HTML:

<iframe width="420"

results in an embedded video when exporting your org file:

[2015-04-12 Sun] # .net bookmarks

[2015-04-10 Fri] # UK property bookmarks

[2015-04-09 Thu] # Git commit message style

Adopted Tim Pope's Git commit message style. Also enabled Emacs's git-commit-training-wheels-mode:

(use-package git-commit-training-wheels-mode :ensure t
  :commands (git-commit-training-wheels-mode))

(use-package git-commit-mode :ensure t
  (add-hook 'git-commit-mode-hook 'git-commit-training-wheels-mode)
  :commands (git-commit-mode))

Another great post by Chris Beams.

[2015-04-06 Mon] # fci-mode and org-html-export-to-html bug

Having enabled fci-mode in most programing modes, org-html-export-to-html now exports an additional unicode character in source blocks. This thread has a workaround:

(defun org-html-fontify-code (code lang)
  ;; ...
  (funcall lang-mode)
  (when (require 'fill-column-indicator nil 'noerror)
    (fci-mode -1))
  (insert code)
  ;; ...

[2015-04-03 Fri] # Try cocoapods out

Cocapods try:

$ pod try POD_NAME

[2015-04-03 Fri] # Cornwall travel bookmarks

[2015-04-03 Fri] # Austria travel bookmarks

[2015-06-02 Tue] updated

[2015-04-02 Thu] # Cinnamon desktop run dialog

Note to self. Open with Alt-f2.

[2015-03-29 Sun] # Books for 2015

[2015-03-29 Sun] # Ayahuasca bookmarks

[2015-03-28 Sat] # Emacs init.el bookmarks

[2015-03-28 Sat] # CSS vertical align using flex

Codepen snippet:

  height: 200px;
  background: #ccc;
  display: flex;
  justify-content: center;
  align-items: center;

  margin: auto

[2015-03-26 Thu] # London diving schools

[2015-03-26 Thu] # Helm buffer URLs

Venturing into Emacs lisp and Helm. Here's a go at listing all URLs in current buffer.

(require 'goto-addr)

(defun ar/helm-buffer-url-candidates ()
  "Generate helm candidates for all URLs in buffer."
    (goto-char (point-min))
    (let ((helm-candidates '())
      (while (re-search-forward goto-address-url-regexp
                                nil t)
        (setq url
              (buffer-substring-no-properties (match-beginning 0)
                                              (match-end 0)))
        (add-to-list 'helm-candidates
                     (cons url

(defun ar/helm-buffer-urls ()
  "Narrow down and open a URL in buffer."
  (helm :sources `(((name . "Buffer URLs")
                    (candidates . ,(ar/helm-buffer-url-candidates))
                    (action . (lambda (url)
                                (browse-url url)))))))

[2015-03-23 Mon] # Doh! undo last git commit

$ git reset --soft HEAD~1

[2015-03-22 Sun] # Resetting variables using defvar

Want to re-evaluate defvars and modify variables? eval-defun (bound to C-M-x) can help. From the manual:

If the current defun is actually a call to `defvar', then reset the variable using its initial value expression even if the variable already has some other value. (Normally `defvar' does not change the variable's value if it already has a value.) Treat `defcustom' similarly.

[2015-03-22 Sun] # Broken Xcode plugins?

Some Xcode plugins stopped loading after updating Xcode. Ensure the latest DVTPlugInCompatibilityUUIDs is added to the plugin's Info.plist. Get from:

$ defaults read \
    /Applications/ DVTPlugInCompatibilityUUID

[2015-03-22 Sun] # Born to Run references

[2015-03-23 Mon] updated

References from reading Christopher McDougall's Born to Run:

Recipe by Megan Mignot, based on book references:

Mama Tita’s Pancakes

  • 1 ½ cups cooked brown rice
  • 1 cup coconut milk
  • 2 ripe bananas
  • 1 tablespoon honey
  • ½ cup white cornmeal
  • 2 teaspoons baking powder

[2015-03-19 Thu] # Org tips from 2015-03-18 Emacs hangout

[2015-03-22 Sun] updated

Lots of great tips in Emacs Hangout 2015-03-18. Favorites:

  • Private org drawer to prevent export:
My super duper secret text I don't want to export.
  • C-c C-p/C-c C-n Jump over sections.
  • (setq org-hide-leading-stars t).
  • (org-bullets-mode).
  • (org-refile).
  • C-u (org-refile) jumps, no refile.
  • (helm-org-in-buffer-headings).

[2015-03-19 Thu] # Food bookmarks

[2015-03-19 Thu] # Ethiopia travel bookmarks

[2015-03-19 Thu] # China travel bookmarks

[2015-03-18 Wed] # South Korea travel bookmarks

[2015-03-18 Wed] # Sharing on iOS

NSString *title = @"Sharing on iOS bookmarks.";
NSURL *url = [NSURL URLWithString:@""];
UIImage *image = [UIImage imageNamed:@"beautiful-image"];

UIActivityViewController *controller =
  [[UIActivityViewController alloc]
    initWithActivityItems:@[title, url, image]

// self being a UIViewController.
[self presentViewController:controller animated:YES completion:nil];
  • Sharing through Mail app on simulator isn't supported.

viewServiceDidTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 3.)" UserInfo=… {Message=Service Connection Interrupted}

[2015-03-18 Wed] # San Francisco travel bookmarks

[2015-03-18 Wed] # Istanbul travel bookmarks

[2015-03-18 Wed] # Rome travel bookmarks

[2015-03-17 Tue] # Italy travel bookmarks

[2015-03-17 Tue] # Emacs lisp debug on entry

Wanted to track down which package was enabling ido-mode on my behalf. debug-on-entry to the rescue. Pass the method name in question and you're good to go.

(debug-on-entry 'ido-mode)

When done, use cancel.

(cancel-debug-on-entry 'ido-mode)

[2015-03-17 Tue] # Burma travel bookmarks

[2015-03-16 Mon] # OS X Screencasts to animated GIF

[2015-03-15 Sun] # Writing Xcode plugins

defaults read \
    /Applications/ DVTPlugInCompatibilityUUID

[2015-03-15 Sun] # Uninstalling Alcatraz from Xcode

$ rm -rf ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin
$ rm -rf ~/Library/Application\ Support/Alcatraz

ps. Removing all plugins:

$ rm -rf ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/*

[2015-03-14 Sat] # Prefill Emacs swiper with current region

The new swiper Emacs package is proving to be a great alternative to helm-swoop. Here's how to prefill with current region:

(defun ar/prefilled-swiper ()
  "Pre-fill swiper input with region."
  (if (region-active-p)
      (let ((region-text (buffer-substring (region-beginning)
        (swiper region-text))

(global-set-key (kbd "C-s")

[2015-03-14 Sat] # Change Mac OS app icon

  • Open the new icon (.icns) in Preview.
  • Select all (⌘-a).
  • Copy (⌘-c).
  • Ctrl-click on app icon.
  • Select Get Info.
  • Click on app icon (top-left).
  • Paste (⌘-v).
  • Done!



[2015-03-11 Wed] # Hack on Emacs London meetup bookmarks

[2015-03-09 Mon] # Working with OS X and Emacs tips

From M-x all-things-emacs, Ryan McGeary's OS X/Emacs workflow.


[2015-03-09 Mon] # Building ycmd


$ git clone
$ cd ycmd
$ git submodule update --init --recursive
$ ./ --clang-completer


$ python ycmd
  serving on

[2015-03-08 Sun] # Regular bookmarks

[2015-03-08 Sun] # Photography bookmarks

[2015-03-08 Sun] # Paris travel bookmarks

[2015-08-27 Thu] updated

[2015-03-08 Sun] # Org mode bookmarks

[2015-03-08 Sun] # London food backlog


Covent Garden


  • TODO Kiraku (Sushi).

Edware road


  • TODO Roti King (Indian/Pakistani/Singaporean): 40, Doric Way, Euston, NW1 1LH.


Golders Green

  • TODO Cafe Japan (Sushi).





  • TODO Atari Ya (Sushi).
  • TODO BAO (Bao buns! enough said).
  • TODO SAID (italian chocolate shop).
  • TODO Shotgun (BBQ).

Sloane Square

South Kensington

  • TODO Hour Glass (Pub restaurant).


Tottenham Court Road.



West Hamstead



  • TODO Fischer's (Austrian).
  • TODO Nambutei (Sushi).

[2015-03-07 Sat] # UX bookmarks

[2015-03-07 Sat] # Unix/Linux tips backlog

rsync --rsync-path=/usr/local/bin/rsync --partial \
    --progress --rsh=ssh john@host:/path/to/file path/to/partial/file

[2015-03-07 Sat] # Recipes

Tom Kha Gai soup

  • Chicken or Prawns
  • 2 kaffir lime leaves
  • 1 lemongrass stalk
  • 1 1/2 cocunut milk
  • 3/4 sliced fresh galaghal
  • 1 1/2 chicken stock or water
  • 1/2 cup mushrooms
  • 3 1/2 tbsp sugar
  • 1/2 cup of cilantro
  • 1-4 thai chillies
  • 1-2 tbsp chili oil
  • 1 green onion

Veg-Fruit juice

  • Lime
  • Ginger
  • Apple
  • Chilly
  • Celery
  • Fig
  • Blueberries

Berry Hempster

  • Hemp milk
  • Hemp protein
  • Strawberry
  • Blueberry
  • Date

How to cook Beef Chow Fun.

[2015-03-07 Sat] # Music backlog

[2015-03-06 Fri] # UX scrapbook bookmarks

[2015-10-09 Fri] # Travel blog bookmarks

[2015-10-22 Thu] updated

[2015-03-06 Fri] # Travel bookmarks

[2015-03-06 Fri] # Startup bookmarks

[2015-11-29 Sun] updated

[2015-03-06 Fri] # Romania travel bookmarks

[2015-03-06 Fri] # Productivity bookmarks

[2015-03-06 Fri] # Privacy bookmarks

[2015-03-06 Fri] # Mindfulness bookmarks

[2015-03-06 Fri] # Lifestyle bookmarks

[2015-10-21 Wed] updated

[2015-03-06 Fri] # iOS imaging bookmarks

[2015-03-06 Fri] # Graphics bookmarks

[2015-03-06 Fri] # Nexus Q bookmarks

[2015-03-06 Fri] # Go bookmarks

[2015-11-29 Sun] updated

[2015-03-06 Fri] # GitHub

[2015-03-06 Fri] # Courses bookmarks

[2015-03-05 Thu] # Reload inputrc

Reload .iputrc from bash prompt: C-x C-r. More at bashref manual.

[2015-03-05 Thu] # Learning Emacs lisp

[2015-04-13 Mon] updated
  • Use nreverse and nconc to operate on lists in-place.
  • Set buffer local variables:
(setq-local my-clever-var)
  • Execute before saving buffer:
(add-hook 'write-file-hooks
          (lambda ()
            (message "about to save!")))
  • Possibly use to start processes and send file content:
(make-comint NAME PROGRAM &optional STARTFILE &rest SWITCHES)
  • Creating markers:
(setq my-marker (copy-marker (point)))
  #<marker at 10251 in *ielm*>

(marker-buffer my-marker)
  #<buffer *ielm*>

(marker-position my-marker)
  10251 (#o24013, #x280b, ?⠋)
  • Get org heading at point:
(org-get-heading 'no-tags 'no-todo)
  • Remove string text properties. From manual:

(substring-no-properties STRING &optional FROM TO)

Return a substring of STRING, without text properties. It starts at index FROM and ends before TO. TO may be nil or omitted; then the substring runs to the end of STRING. If FROM is nil or omitted, the substring starts at the beginning of STRING. If FROM or TO is negative, it counts from the end.

  • Skip org entry metadata/drawers:
  • Random access to org entry using id (or CUSTOM_ID):
(org-open-link-from-string "[[#%exciting-custom-id]]")
  • Go to where the function is defined.
  • Press C-u C-M-x. Edebug breakpoint for function.
  • Invoke function in question.
  • n/c will get you around.
  • q when done.
  • Pretty printing objects:
(let ((my-var (list "val1"
  (pp-to-string my-var))
  • Search and/or replace in curent buffer:
(re-search-forward "needle"
                   nil t)
(match-beginning 0) ;; Start location of match from last search.
(match-end 0) ;; End location of match from last search.
(replace-match "love")

;; needle-in-haystack
  • Restrict buffer editing to a region:
(narrow-to-region (point)
  • Restore restriction:
(save-restriction (narrow-to-region (point)
  • Restore point, mark, and current buffer:
(save-excursion (goto-char (point-max))
                (insert "Hello elisp."))
  • Concatenating strings:
(concat "Hello " "elisp " "world.")
  • Grabbing thing at point:
(thing-at-point 'word)
(thing-at-point 'symbol)
(thing-at-point 'line)
  • Unit test with ert.
  • Basic iteration with dolist:
(dolist (v '("a" "b" "c"))
  (print v))
  • Output to other buffer:
(with-current-buffer (get-buffer-create "*some buffer*")
  (princ '(some list to print)
  • For a temporary buffer, use with-temp-buffer:
  (insert "abc")
  • Cons cells bookmark.
  • Check for substring:
(string-match-p REGEXP STRING &optional START)
  • Matching substrings and accessing groups:
(setq haystack "Always click [[][here]].")
(setq needle-re "\\[\\[\\(.*\\)]\\[\\(.*\\)]]")

(string-match needle-re haystack)
  13 (#o15, #xd, ?\C-m)

(match-string 0 haystack)

(match-string 1 haystack)

(match-string 2 haystack)
  • Return argument unchanged (noop):
(identity ARG)
  • Org insert today's timestamp
(org-insert-time-stamp (current-time))
(car LIST)
  • All but first element
(cdr LIST)
  • Add NEWELT to front of PLACE
  • Invoke 'FUNCTION for each in SEQUENCE
  • Search/replace
(while (search-forward "Hello")
  (replace-match "Bonjour"))
  • Save to kill ring = copy.
  • Point = cursor position.
  • Mark = a buffer position.
  • Kill = cut text.
  • Yank = paste.
  • Buffer:File = 1:1.
  • Window:Buffer = 1:1.
  • Frame:Window = 1:many.
  • Font lock = syntax highlighting.

[2015-03-05 Thu] # iOS bookmarks

[2015-11-27 Fri] updated

[2015-03-05 Thu] # Kerala travel bookmarks

  • Bagel Shop, 30 Pali Mala Road, off Carter Road, Bandra (W) (+91 22 2605-0178). Daily 9.00AM-10.00PM. Meal for two R500-R800.
  • Hotel Natraj, 22-24 City Station Road, Udaipur (near Bapu Bazaar), +91-294-2487488, +91-94147-57893,
  • Kala Ghoda Café,10 Ropewalk Lane, Kala Ghoda (+91 22 2263-3866). Daily 8.30AM-11.30PM. Meal for two R600.
  • Kochin (Fort Kochin) - old port town with Chinese, Portuguese, Dutch, British and Jewish heritage.
  • Munnar - hill station and centre of tea, coffee and spice growing. Great hiking and spectacular views.
  • Periyar Wildlife Sanctuary.
  • Suzette, Atlanta Building, Nariman Point (+91 22 2288-0055). Daily 9.00AM-11.00PM. Also at Bandra. Meal for two R600-R1,000.
  • Varkala - chilled out beach resort.
  • Yoga House, 53 Chimbai Road, behind St Andrew's Church, off Hill Road, Bandra (W)(+91 22 6554- 5001). Daily 7.00AM-10.30PM.

[2015-03-05 Thu] # India travel bookmarks

[2015-11-21 Sat] updated

[2015-03-05 Thu] # Git bookmarks

[2015-03-04 Wed] # Language learning bookmarks

[2015-02-18 Wed] # Git conflict resolution déjà vu?

use git rerere. here's a post.

[2015-01-17 Sat] # Graphics design tools bookmarks

[2015-04-23 Thu] # Emacs key bindings and maps

based on

bonus tip

prefix key, followed by c-h, lists keys in prefix.


maps key to action.

keymap found in buffer and most major modes.


  • undefined: self explanatory.
  • prefix key: ie. c-x (part of complete key).
  • complete key: complete input executes associated command.


  • (define-key keymap key def): add to current buffer map.
  • (local-set-key key command): add to active buffer (no map option).
  • (local-unset-key key)
  • (global-set-key key command): add to global keymap (all buffers).
  • (global-unset-key key)

key codes

  • kbd: macro transaltes human-readable key to emacs readable.
  • function and navigation keys must be surrounded by <>.
  • example: (kbd "c-c p") or (kbd "<f8>") of (kbd "<down>").


  • use remap to replace mapping (ie. kill-line with my/kill-line).
  • (define-key keymap [remap original-function] 'my-own-function).

reserved keys

  • "c-c ?" generally reserved for you, but third party packages use it.
  • function keys (ie. f1-f12).
  • hyper and super (ancient).

lookup order

  • in a nutshell: minor mode keys, local keys, global keys.
  • full order:
    1. overriding-terminal-local-map: terminal-specific key binds.
    2. overriding-local-map: override all other local keymaps (avoid if possible).
    3. char property at point: useful for yasnippet.
    4. emulation-mode-map-alists: advanced multi-mode keymap.
    5. minor-mode-overriding-map-alist: minor modes in major modes.
    6. minor-mode-map-alist: as previous (preferred for minor modes) <–—
    7. current-local-map: buffers current local map.
    8. current-global-map: last place to look (ie. global).

mode hooks

  • (local-set-key (kbd "c-c q") 'my-awesome-method)) in hook-method.
  • for key-chord-define, use current-local-map.

[2014-12-30 Tue] # Video backlog

[2014-12-30 Tue] # Travel gear

[2014-09-18 Fri] # Origami bookmarks

[2014-12-30 Tue] # Movie backlog

[2014-12-29 Mon] # Microservices bookmarks

[2014-12-30 tue] # Books backlog

[2014-12-29 mon] # Gardening bookmarks

[2014-12-03 wed] # Emacs tips backlog

[2014-07-09 Thu] # Installing Emacs 24.4 on Linux

sudo apt-get install texinfo build-essential xorg-dev libgtk-3-dev libjpeg-dev libncurses5-dev libgif-dev libtiff-dev libm17n-dev libpng12-dev librsvg2-dev libotf-dev

[2014-07-09 Thu] # Installing Emacs 24.4 on Mac OS X

See Yamamoto's Mac OS X port. To install:

$ brew tap railwaycat/emacsmacport
$ brew install emacs-mac

[2014-11-02 Sun] # Xcode6 tips


  • ⌘⇧o Fuzzy file search.
  • ⌘⌥j Fuzzy file search (showing in Xcode project hierarchy).
  • ⌘⇧j Show file in Xcode project hierarchy.
  • ⌘⌥0 Show/hide utility area (right panel).
  • ⌘0 Show/hide navigation area (left panel).
  • ⇧⌘Y Show/hide debug area (bottom panel).
  • Ctrli Indent selection.
  • ⌘\ Toggle breakpoint on line.
  • ⌘/ Toggle comment.
  • ⌘[1-8] Select tabs on left panel.
  • Ctrl[1-x] Select top file navigation menu items.

Xcode features

  • Snippets.
  • Templates.
  • View debugging.
  • Simctl (send files to simulator).

Plugins of interest

  • Fuzzy autocomplete.
  • Uncrustify for indentation.
  • xcs code switch expansion.
  • Org and order (for properties).

[2014-09-20 Sat] # Emacs lisp bookmarks

[2014-09-19 Fri] # Emacs bookmarks

[2015-11-21 Sat] updated

[2014-09-11 Thu] # Resetting gnome-terminal preferences

Resetting preferences

gconftool --recursive-unset /apps/gnome-terminal

Want 256 colors?

Edit .bash_profile

export TERM="screen-256color"

Ensure .bash_profile is loaded

From gnome-terminal window:

        Title and Command
          X Run command as login shell


Bonus: See post to get solarized on gnome-terminal.

[2014-10-09 Fri] # C++ bookmarks

[2014-07-14 Mon] # Java bookmarks

[2014-07-14 Mon] # Browser bookmarks

[2014-07-14 Mon] # Node bookmarks

[2014-07-14 Mon] # Javascript bookmarks

[2014-07-14 Mon] # HTML5 bookmarks

[2014-07-14 Mon] # Networking bookmarks

[2014-07-13 Sun] # Python bookmarks

[2014-07-13 Sun] # Development bookmarks

[2013-11-04 Mon] # Some python idioms

  • Prefer double quotes if escaping single quotes.
  • Prefer string interpolation over join. Eg. "'%s'" % member_default.
  • Prefer double underscore for privates.
  • Prefer with statement to implicitly close file.
with open(path, 'r') as text_file:
    text =
  • Prefer list comprehensions to filter.
  • Prefer using separate modules over classes if only using for separation.
  • Keep in mind: "eafp vs lbyl" (ie. just let it throw).
  • Prefer exceptions over assertions.
  • Throw ValueError for wrong input.
  • Return explicit False if remaining case is always false.