Skip to content

Instantly share code, notes, and snippets.

@minrk
Created February 3, 2011 06:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minrk/809123 to your computer and use it in GitHub Desktop.
Save minrk/809123 to your computer and use it in GitHub Desktop.
Strongspace to SFTP bookmarklet
javascript:function ss_to_sftp(){
var host=document.location.host;
var path=document.location.hash;
if (host!='www.strongspace.com'){
alert('You do not appear to be at strongspace!');
return;
}
var m=path.match(/^#\w+/i);
if (m==null){
alert('you do not appear to be viewing a file');
return;
}
m=m[0];
var username=m.substring(1);
var realpath=path.substring(m.length);
var url='sftp://'+username+'.strongspace.com//strongspace/'+username+realpath;
document.location=url;
};ss_to_sftp();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment