Skip to content

Instantly share code, notes, and snippets.

@youpy
Created August 28, 2008 04:14
Show Gist options
  • Save youpy/7656 to your computer and use it in GitHub Desktop.
Save youpy/7656 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name gist - ubiquity
// @namespace http://d.hatena.ne.jp/youpy/
// @include http://gist.github.com/*
// @require http://gist.github.com/raw/3242/1a7950e033a207efcfc233ae8d9939b676bdbf46
// ==/UserScript==
(function() {
var data = $X('id("gist_data")');
if(!data)
return;
if(data[0].textContent.match(/(CmdUtils\.CreateCommand|makeSearchCommand)/)) {
var link = document.createElement('link');
with(link) {
setAttribute('rel', 'commands');
setAttribute('href', $X('//a[text()="raw"]')[0].href);
setAttribute('name', data[0].textContent.match(/name: ?("((?:\\.|[^"])*)"|'((?:[^']|\\.)*)')/)[3]);
}
$X('//head')[0].appendChild(link);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment