This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function xml2dom(xml, doc) { | |
xml = <root xmlns={ doc.documentElement.namespaceURI }/>.appendChild(xml); | |
var settings = XML.settings(); | |
XML.prettyPrinting = false; | |
var root = new DOMParser().parseFromString(xml.toXMLString(), 'application/xml').documentElement; | |
XML.setSettings(settings); | |
doc.adoptNode(root); | |
var range = doc.createRange(); | |
range.selectNodeContents(root); | |
var frag = range.extractContents(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name altTooltip.uc.js | |
// @description title がなければ alt を出す | |
// @include main | |
// @compatibility Firefox 3.5+ | |
// @namespace http://twitter.com/xulapp | |
// @author xulapp | |
// @license MIT License | |
// @version 2010/04/01 21:00 +09:00 | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getFunctionName(fn) { | |
return fn.name || ('' + fn).replace(/^function|\s*\([\s\S]+|(?:\s*\/(?:\/.*|\*[\s\S]*?\*\/)\s*)*/g, '') || 'anonymous'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Disable the SOPA overlay on English Wikipedia | |
// @author Mathias Bynens <http://mathiasbynens.be/> | |
// @match http://en.wikipedia.org/* | |
// ==/UserScript== | |
// http://mths.be/unsafewindow | |
window.unsafeWindow || ( | |
unsafeWindow = (function() { | |
var el = document.createElement('p'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){ | |
/* | |
Adblock のフィルタを urlfilter.ini に変換する | |
ついてに広告カット CSS も作成 | |
https://adblock-plus-japanese-filter.googlecode.com/hg/abp_jp.txt で実行 | |
|| で始まる行は http, https の2行に、^ は "/*" に、$のある行はスルー。 | |
CSS は -moz-document を使っている部分があるので Opera では前半のみ利用可能 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body id="B" onload=setInterval('t=new(Date)/210&31;B.innerHTML=28<t?"Let\'s\(・ω・)/にゃー!":["(」・ω・)」うー!","(/・ω・)/にゃー!"][19<t?1:t/4&1]',4)> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var user = { | |
validateCredentials: function (username, password) { | |
return ( | |
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' } | |
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' } | |
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' } | |
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' } | |
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' } | |
: false | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// muhaha.. changed all the code | |
// maybe this version handles scrolling to the bottom edge of a document a little better | |
// still not satisfied with the speed variable.. should that be higher == more speed, perhaps? or pixels per second? | |
// sorry about the opinionated style changes | |
Scrolling = { | |
smoothScrollTo: function(target_top) { | |
// ensure that we never scroll further than viewport size from bottom of the doc | |
target_top = Math.min(target_top, Math.max($(document).height(), $(window).height()) - $(window).height()); | |
var speed = 30, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:/*Zenkaku-Hankaku*/(function(doc){ | |
var zen = /[\u3000\uFFE5\uFF01-\uFF5E]/g; | |
var arr = ['contains(.,"\u3000")','contains(.,"\uFFE5")']; | |
for (var i = 0xFF01; i < 0xFF5E; ++i) { | |
arr.push('contains(.,"' + String.fromCharCode(i) + '")'); | |
} | |
var xpath = '//text()[(' + arr.join(' or ') + ') and not(ancestor::style) and not(ancestor::script)]'; |
OlderNewer