Skip to content

Instantly share code, notes, and snippets.

View brianhanifin's full-sized avatar
💭
Happy to be contributing!

Brian Hanifin brianhanifin

💭
Happy to be contributing!
View GitHub Profile
CmdUtils.CreateCommand({
name: "snipurl",
synonyms: ["Snipr", "snim", "sn.im", "snurl"],
icon: "http://snipurl.com/site/favicon.ico",
description: "Replaces the selected URL with a <a href=\"http://snipr.com\">Snipr</a> URL",
//help: "how to use your command",
homepage: "http://code.brianhanifin.com/",
author: { name: "Brian J. Hanifin", email: "code@brianhanifin.com"},
license: "GPL",
takes: {"input": noun_type_url},
CmdUtils.CreateCommand({
name: "trim",
synonyms: ["tr.im"],
icon: "http://tr.im/favicon.ico",
description: "Replaces the selected URL with a <a href=\"http://tr.im\">tr.im</a> shortened URL.",
//help: "how to use your command",
homepage: "http://code.brianhanifin.com/",
author: { name: "Brian J. Hanifin", email: "code@brianhanifin.com"},
license: "GPL",
takes: {"input": noun_type_url},
CmdUtils.makeBookmarkletCommand({
name: "Retail Me Not",
synonyms: ["promo"],
url: "javascript:void(open('http://retailmenot.com/view/'+encodeURIComponent(document.domain)));"
})
CmdUtils.makeBookmarkletCommand({
name: "darken",
url: "javascript:(function(){var%20newSS,%20styles='*%20{%20background:%20black%20!%20important;%20color:%20grey%20!important%20}%20:link,%20:link%20*%20{%20color:%20#0000EE%20!important%20}%20:visited,%20:visited%20*%20{%20color:%20#551A8B%20!important%20}';%20if(document.createStyleSheet)%20{%20document.createStyleSheet(%22javascript:'%22+styles+%22'%22);%20}%20else%20{%20newSS=document.createElement('link');%20newSS.rel='stylesheet';%20newSS.href='data:text/css,'+escape(styles);%20document.getElementsByTagName(%22head%22)[0].appendChild(newSS);%20}%20})();"
})
CmdUtils.makeBookmarkletCommand({
name: "tumblr",
url: "javascript:var%20d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='http://www.tumblr.com/share',l=d.location,e=encodeURIComponent,p='?v=3&u='+e(l.href)%20+'&t='+e(d.title)%20+'&s='+e(s),u=f+p;try{if(!/^(.*\.)?tumblr[^.]*$/.test(l.host))throw(0);tstbklt();}catch(z){a%20=function(){if(!w.open(u,'t','toolbar=0,resizable=0,status=1,width=450,height=430'))l.href=u;};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();}void(0)"
})
CmdUtils.makeBookmarkletCommand({
name: "readability",
icon: "http://lab.arc90.com/favicon.ico",
homepage: "http://lab.arc90.com/experiments/readability/",
url: "javascript:(function(){readStyle='style-ebook';readSize='size-large';readMargin='margin-medium';_readability_script=document.createElement('SCRIPT');_readability_script.type='text/javascript';_readability_script.src='http://lab.arc90.com/experiments/readability/js/readability-0.1.js?x='+(Math.random());document.getElementsByTagName('head')[0].appendChild(_readability_script);_readability_css=document.createElement('LINK');_readability_css.rel='stylesheet';_readability_css.href='http://lab.arc90.com/experiments/readability/css/readability.css';_readability_css.type='text/css';document.getElementsByTagName('head')[0].appendChild(_readability_css);_readability_print_css=document.createElement('LINK');_readability_print_css.rel='stylesheet';_readability_print_css.href='http://lab.arc90.com/experiments/readability/css/readability-print.css';_r
CmdUtils.makeSearchCommand({
name: "lifehacker-search",
url: "http://lifehacker.com/search/{QUERY}/",
icon: "http://lifehacker.com/favicon.ico",
description: "Searches lifehacker.com"
});
@brianhanifin
brianhanifin / ubiquity-pricegrabber.js
Created March 7, 2009 21:15
Pricegrabber.com search
CmdUtils.makeSearchCommand({
name: "pricegrabber-search",
url: "http://www.pricegrabber.com/search.php?form_keyword={QUERY}&st=query&kw_suggest=0",
icon: "http://www.pricegrabber.com/favicon.ico",
description: "Searches www.pricegrabber.com"
});
@brianhanifin
brianhanifin / ubiquity-arcade-related.js
Created March 17, 2009 21:23
Arcade Related Searches
@brianhanifin
brianhanifin / gist:1328593
Created October 31, 2011 19:27
Obj-C: Code execution timing snippet
NSDate *start = [NSDate date];
.
.
.
NSLog(@"duration: %f", [start timeIntervalSinceNow]);