Skip to content

Instantly share code, notes, and snippets.

@dbgrandi
Created February 24, 2011 13:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dbgrandi/842158 to your computer and use it in GitHub Desktop.
Save dbgrandi/842158 to your computer and use it in GitHub Desktop.
make hoptoad errors link directly to textmate
// ==UserScript==
// @name Hoptoad Textmate Backtrace
// @namespace hoptoad
// @description Add textmate links to application stacktrace lines on error pages
// @include https://YOURACCOUNT.hoptoadapp.com/errors/*
// ==/UserScript==
//
// based on original script from http://userscripts.org/scripts/show/63465
// with much help from @orta
//
//update the path below to match the common parent directory of all your applications
var project_parent_directory ='/Users/YOURUSER/projects/YOUR_PROJECTS_ROOT/';
// github links are nicely marked up in hoptoad
var github_links = jQuery("a.github-link")[0]
//pull the github project name from the github link
var project_name = jQuery(github_links).attr("href").split('/')[4];
jQuery("a.github-link").each(function(index,item) {
i = item.text.split(':')
jQuery(item).attr("href", "txmt://open?url=file://" + project_parent_directory + project_name + "/" + i[0] + "&line=" + i[1])
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment