Skip to content

Instantly share code, notes, and snippets.

@johan
Created November 11, 2012 05:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johan/4053870 to your computer and use it in GitHub Desktop.
Save johan/4053870 to your computer and use it in GitHub Desktop.
User script: Select text to make github line permalinks

Better line (and line range) permalinking UX at github.com

Video description, where I borrow @holman's demo of the tribal knowledge you currently need to have to use this great feature, while mentioning how you use this user script after installing it.

♡Copyheart 2012, Johan Sundström. Copying is an act of love. Please share and use however you like!

NB: This user script doesn't rely on jQuery (so it'll happily run in Chrome's Isolated Worlds user script sand box, besides in Greasemonkey, where the site's version is around, or dotjs, where it's around all the time). If you are github and don't need to care about that, or want the shorter one, grab https://github.com/johan/user.js/blob/master/github.com/line-permalinks.user.js#L9-44 instead.

<!DOCTYPE html><html><head>
<!-- for a pretty version with embedded video docs at http://bl.ocks.org/4053870 -->
<title>Github UX improv</title>
</head><body>
<iframe src='http://popcorn.webmadecontent.org/1tl_' width='853' height='523' frameborder='0' mozallowfullscreen webkitallowfullscreen oallowfullscreen allowfullscreen></iframe>
<script>var s = frameElement.style; s.height = '523px'; s.width = '853px';</script>
</body></html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment