Skip to content

Instantly share code, notes, and snippets.

@joelmoss
Forked from avit/README
Created December 29, 2009 10:24
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 joelmoss/265247 to your computer and use it in GitHub Desktop.
Save joelmoss/265247 to your computer and use it in GitHub Desktop.
Bookmarklet to add links to TextMate from your Hoptoad stack trace.
Change the lpd variable to your local project directory. It relies on your project folders being named after the main part of your domain name ("example" from "example.com")
javascript:lpd='/Users/andrew/Sites/';htp=document.getElementsByClassName('url')[0].innerHTML.match(/http:\/\/(www\.)?([^\.]+)/)[2];htt=document.getElementById('backtrace').getElementsByTagName('p');for(i=0;i<htt.length;i++){m=htt[i].innerHTML.match(/^([^ ]+\.(e?rb|haml|builder)):(\d+)/);if(m){htt[i].innerHTML=htt[i].innerHTML.sub(m[1],'<a onclick="" href="txmt://open?url=file://'+lpd+htp+'/'+m[1]+'&line='+m[2]+'">'+m[1]+'</a>')}};void(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment