Skip to content

Instantly share code, notes, and snippets.

@aharpole
Created March 27, 2015 21:03
Show Gist options
  • Select an option

  • Save aharpole/d6a6f95b3704014f5838 to your computer and use it in GitHub Desktop.

Select an option

Save aharpole/d6a6f95b3704014f5838 to your computer and use it in GitHub Desktop.
a Greasemonkey script for Tower users to Open in Tower using SSH instead of HTTPS
// ==UserScript==
// @name GitHub open in desktop ssh
// @namespace 1427488342954
// @version 0.1
// @updateURL
// @downloadURL
// @include https://github.com/*
// ==/UserScript==
$(document).ready(function() {
$('a.sidebar-button').each(function() {
var re = /^github-mac/;
if($(this).attr('href').match(re)) {
var pieces = $(this).attr('href').split('/');
var newHref = "github-mac://openRepo/git@github.com:" + pieces[pieces.length - 2] + "/" + pieces[pieces.length - 1];
$(this).attr('href',newHref)
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment