A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Vim mappings for commands like JSON pretty-print and perltidy

imap :!python -m json.tool
map :%!perltidy

?
nmap :%!python -m json.tool

# AB
nmap :%!python -m json.tool
map :!perl -cW %
map :%!perltidy
map :resize +10

How to work with dist.ini as a user

You are a developer who needs to work with a Perl package. Instead of a cpanfile it has a dist.ini. Pop quiz, hot shot: What do you do?

Answer:

  • cpm install Dist::Zilla
  • dzil build
  • Follow instructions to install dependencies using cpanm
    • Or if you prefer cpm (and you should), then try this: dzil listdeps | xargs cpm install
  • Or: dzil authordeps --missing | xargs cpm install

Mac clients for AWS RedShift

JetBrains just released DataGrip ( JetBrains DataGrip: Your Swiss Army Knife for Databases and SQL ). I've been using it full time during the EAP (aka "beta"). It's expensive ($90/yr or $9/mth) but very, very good. Never loses your work. Starts up right where it left off. Dark and light themes. DB specific syntax highlighting. Good stuff.

Before that I was using Navicat Premium Essentials. I got it for ~$20. It's now ~$150 which is too much given it's limited functionality and spotty reliability IMO.
re:dash is overly simple for serious use IMO. Edit: We're actually using this now. It's more of service than an SQL client. It allows casual users (e.g. not full time analysts) to run queries without any setup. Great for centralised dashboards and sharing queries. Try this before you commit to something like Periscope, Looker or Mode.
Portico (was PG Commander) looks interesting but I (personally) need to work with multiple database flavors so it's a non-starter.
SQuirreL and SQL Workbench/J are both pretty crunchy and old feeling Java apps. If you've been on a Mac for a while they will make your eyes bleed.
There is also Toad on the Mac App Store. The screenshots look Mac native but it's pretty crunchy and unpleasant. It feels like going back in time.
Update 2016–09–02: I would suggest that you also look into the “code notebook” applications that are available now, e.g. JupyterZeppelin, and Beaker. You may well find these tools more useful unless you’re a full time DBA. We have replaced Re:Dash with Zeppelin internally.


Why Android is better then iPhone

A list:
  • Homescreen widgets
  • Custom homescreen launchers, e.g. Nova Launcher
  • Custom homescreen icon arrangement
  • Notifications persist visibly in status bar so you don't forget them
  • Plentiful game console emulators
  • Easily download files from web pages
  • Easily load mp3 music without special software
  • Save any file to the phone storage, like you can with Windows/Mac/Linux

Migrate everything from iPhone to Android

How to transfer all your stuff from iPhone to Android:

  • Photos - install Google Photos app on iPhone and it will back up everything to the Google cloud.
  • Contacts - Add a gmail account on your iPhone and configure it to sync contacts (alternatively, you could export a vCard/VCF).
  • Calendar - Add a gmail account to the iPhone and configure it to sync calendar.
  • Notes - Add a gmail account to the iPhone and configure it to sync notes (there are also other ways).
  • SMS text messages - Use iSMS2droid
  • Email - on the Android phone, go to Settings | Accounts | Add account, and choose Personal IMAP/POP3 or Exchange, according to the type of email account you have
  • WhatsApp chat history - Use WhazzapMigrator (source, source)
  • Apps - you will have to install new Android apps manually. Your app data will be lost unless they have their own cloud backup.

Remember to TURN OFF iMessage before you switch over, otherwise your SMS may get lost (source)


Afterward, you can easily check some of your data has been migrated at:

Finally, bask in the satisfaction that Android is better than iPhone.