Skip to content

Instantly share code, notes, and snippets.

View gist_link_user_js.user.js
View gist_link_user_js.user.js
View dollarX.js
// Simple $X
// Thx! $X from http://coderepos.org/share/browser/lang/javascript/userscripts/jautopagerize.user.js
// http://subtech.g.hatena.ne.jp/cho45/20071114/1195017746
function $X (exp, context) {
context || (context = document);
var exp = (context.ownerDocument || context).createExpression(exp, function (prefix) {
return (document.createNSResolver((context.ownerDocument == null
? context : context.ownerDocument).documentElement)
.lookupNamespaceURI(prefix) || document.documentElement.namespaceURI);
});
View replaceStarByProfileIcon.user.js
// ==UserScript==
// @name replace star by profile icon
// @namespace http://ss-o.net/
// @description replace star by profile icon (for Firefox3)
// @include http://*.hatena.ne.jp/*
// @version 1.3
// ==/UserScript==
location.href = 'javascript:(' + function(){
var COLOR = true;
View dollarX.js
// extend version of $X
// $X(exp);
// $X(exp, context);
// $X(exp, type);
// $X(exp, context, type);
function $X (exp, context, type /* want type */) {
if (typeof context == "function") {
type = context;
context = null;
}
@os0x
os0x / dollarX.js
Created Jul 30, 2008 — forked from cho45/dollarX.js
simple $X
View dollarX.js
// simple version of $X
// $X(exp);
// $X(exp, context);
// @source https:/raw.github.com/gist/3242
function $X (exp, context) {
context || (context = document);
var expr = (context.ownerDocument || context).createExpression(exp, function (prefix) {
return document.createNSResolver(context.documentElement || context).lookupNamespaceURI(prefix) ||
context.namespaceURI || document.documentElement.namespaceURI || "";
});
View gist:6538
// ==UserScript==
// @name MDC relink
// @namespace http://d.hatena.ne.jp/Constellation/
// @description relink MDC
// @include http://developer.mozilla.org/*
// ==/UserScript==
(/http:\/\/developer\.mozilla\.org\/(.+)\/(ja|en)$/i.test(document.location.href)) && (document.location.href = 'http://developer.mozilla.org/'+RegExp.$2+'/'+RegExp.$1);
View tween.js
/*
// Tweener Like snippet
new Tween(div.style,{time:1, onComplete:function(){},left:{to:0,from:100,tmpl:"+$#px"}});
// @require http://gist.github.com/13572.txt
*/
function Tween(item, opt) {
var self = this, TIME = 10, time = (opt.time||1) * 1000, TM_EXP = /(\+)?\$([\#\d])/g, sets = [],
easing = opt.transition || function(t, b, c, d){return c*t/d + b;}, _T = {time:1,onComplete:1,transition:1,delay:1};
for (var k in opt) if (!_T[k]) {
var set = opt[k], from = set.from || parseFloat(item[k]) || 0, values = [], tmpl = set.tmpl || '$#';
@youpy
youpy / gist_link_user_js.user.js
Created Nov 19, 2008 — forked from hotchpotch/gist_link_user_js.user.js
gist.user.js with fixed script URL
View gist_link_user_js.user.js
@os0x
os0x / dollarX.js
Created Nov 27, 2008 — forked from cho45/dollarX.js
very simple $X
View dollarX.js
// very simple version of $X
// $X(exp);
// $X(exp, context, resolver, XPathResult.NUMBER_TYPE).numberValue;
// @source https:/raw.github.com/gist/29681
function $X (exp, context, resolver, result_type) {
context || (context = document);
var Doc = context.ownerDocument || context;
var result = Doc.evaluate(exp, context, resolver, result_type || XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
if (result_type) return result;
for (var i = 0, len = result.snapshotLength, res = new Array(len); i < len; i++) {