miércoles, 21 de octubre de 2015

Command line bookmarks

I saw a Gary Bernhardt's talk where he explains a few console tricks. Most of the tricks themselves I already knew, but the biggest outcome of seeing the talk is the motivation for scripting everything and using small functions to use bash/zsh the fastest possible way.

I'm a big fan of zsh, and I have a fairly big .zshrc (101 aliases, for example).

At work, we use a quite strict and orthogonal way to tag all project issues, so that one can find out easily which issues are waiting for merge, which are halted, or which are being worked on.  As we use github, the usual way is log into github (or waffle) and search .

But when it starts getting repetitive, I usually think how to do it faster. one option was bookmarks in conkeror, but it didn't quite work.

Now, I'm using this in my .zshrc :


function ghnext {$BROWSER "https://github.com/3scale/$PROJECT/issues?q=is%3Aopen+label%3AT-core+label%3AB-Next"}
function ghmerge {$BROWSER "https://github.com/3scale/$PROJECT/labels/needs%3A%20merge"}
function ghmy-issues {$BROWSER "https://github.com/3scale/$PROJECT/issues?utf8=%E2%9C%93&q=is:open+assignee:kidd"}
function gh3scale {$BROWSER "https://github.com/3scale/$PROJECT"}
function ghissues {$BROWSER "https://github.com/3scale/$PROJECT/issues"}
function ghcurr {$BROWSER "https://github.com/3scale/$PROJECT/issues?q=is%3Aopen+label%3AB-current+label%3AT-core"}
And here is gary's talk: