Skip to content

Instantly share code, notes, and snippets.

SourceData source-data

Block or report user

Report or block source-data

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Ubiquity command open-doi
CmdUtils.CreateCommand({
//to install this command, visit http://gist.github.com/21865
//code is part of http://code.google.com/p/tl-ubiquity-commands/
name: "open-doi",
takes: {"selected text": noun_arb_text},
preview: function(pblock, directObject){
if (directObject.text){
var m = directObject.text.match(/(doi:)?.*?\b(10\.\d{4}\/\S+)/i);
if (!m){pblock.innerHTML="The selection <pre>"+directObject.text+"</pre> does not include a recognized doi !";}
else {pblock.innerHTML="press Return to go to the document associated with <i>"+m[2]+"</i>.";}
@source-data
source-data / more-like-this
Created Oct 8, 2008
Ubiquity command more-like-this
View more-like-this
CmdUtils.CreateCommand({
//to subscribe to the command, go to http://gist.github.com/15544
//code maintained at http://code.google.com/p/tl-ubiquity-commands/
author: {name: "thomas lemberger", email: "thomas.lemberger@embo.org"},
license: "GPL",
name: "more-like-this",
takes: {"selected text": noun_arb_text},
help: "The command is based on Jane (http://www.biosemantics.org/jane/, Schuemie & Kors (2008) Bioinformatics.24:727). It lists PubMed records related to the selected text (typically an abstract).",
execute: function(directObj) {
var selectedText=directObj.text;
View whatizit
function HTMLescape(string) {
var LT = new RegExp("<", "g");
var GT = new RegExp(">", "g");
var AMP = new RegExp("&", "g");
var TAB = new RegExp("\t", "g");
return string.replace(AMP,"&amp;").replace(LT, "&lt;").replace(GT, "&gt;").replace(TAB, "...");
}
CmdUtils.CreateCommand({
name: "whatizit",
View rewrap.js
CmdUtils.CreateCommand({
names: ["rewrap"],
arguments: [{role: "object",
nountype: noun_arb_text,
label: "input"}],
help: "removes unnecessary carriage returns and strings of spaces",
execute: function(arguments) {
var selectedText=arguments.text;
selectedText=selectedText.replace(/[\r\n]{2}/g,"§#!");
selectedText=selectedText.replace(/[\r\n]+/g," ");
@source-data
source-data / search-pubmed
Created Sep 29, 2008
Ubiquity pubmed search command
View search-pubmed
makeSearchCommand({
//to subscribe to the command ,go to: <http://gist.github.com/13700>
//project: <http://code.google.com/p/tl-ubiquity-commands/>
author: {name: "Thomas Lemberger", email: "thomas.lemberger@gmail.com"},
license: "GPL",
name: "pubmed",
help: "Search selected terms or directly typed in the input line. The number of records to be displayed can be specified by adding '#number' somewhere in the query (eg. #3 will show only 3 records, default is 5, maximum is 15).",
url: "http://www.ncbi.nlm.nih.gov/pubmed?term={QUERY}",
icon: "http://www.ncbi.nlm.nih.gov/favicon.ico",
description: "Searches <a href='http://www.ncbi.nlm.nih.gov/pubmed'>PubMed</a>.",
@source-data
source-data / word-cloud
Created Sep 29, 2008
generates a word cloud on the fly
View word-cloud
/************************************************
*WordCloud methods below are modifications of wordcloud by yoah.bardavid@gmail.com and razbarvaz@gmail.com
*wordcloud is part of the following project: http://visapi-gadgets.googlecode.com
*The visapi-gadgets project is licensed under Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*Modifications include:
* inclusion of a some sort of a log scale
* exclusion of single letter words
* exclusion of excludedTerms
* exclusion of numbers
* attempt to merge plural and singular
You can’t perform that action at this time.