This file contains hidden or 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
<!DOCTYPE html> | |
<script> | |
document.write('<pre>'); | |
function $(x){ | |
var _ = {valueOf: function v(a){ | |
document.writeln(x +'\n -> _.valueOf('+ JSON.stringify(a) +')'); | |
}}; | |
eval(x); | |
} | |
$('Object(_)'); |
This file contains hidden or 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
CmdUtils.CreateCommand({ | |
names: ['open links', 'linkopen'], | |
description: 'Opens links from among the current page.', | |
icon: 'chrome://ubiquity/skin/icons/tab_go.png', | |
arguments: [{role: 'object', nountype: noun_arb_text}], | |
preview: function preview(pblock, {object: {text}}) { | |
var me = this, links = me._links(text); | |
if(!links.length) return void this.previewDefault(pblock); | |
CmdUtils.previewList( |
This file contains hidden or 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
const FFInfo = 'http://www.fileformat.info/' | |
, H = Utils.escapeHtml | |
CmdUtils.CreateCommand({ | |
name: 'unicode info', | |
icon: FFInfo +'favicon.ico', | |
argument: {object_unicode: { | |
suggest: function ucnfo_suggest(txt){ | |
var t = txt.replace(/[\x00-\x20]+/g, ''), c, sp | |
if(/^&\w{2,}/.test(t)) t = Utils.unescapeHtml(RegExp.lastMatch +';') |
This file contains hidden or 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 zen4x(zc){ | |
var word = /[-\w$]+/, char = /^[^]/, digits = /\d+/; | |
var kv = /([-\w$]+)(?:=([^\]]*))?\]?/, content = /{([^\}]*)}?/; | |
var zs = zc.trim().split(/\s{0,}([>+])\s{0,}/); | |
var root = <_/>, curs = [root], sep; | |
for(let i = -1, l = zs.length; ++i < l; sep = zs[++i]){ | |
let [name] = word(zs[i]) || ''; | |
if(!name) continue; | |
let lm = <{name}/>, n = 1; | |
for(let _, m; char.test(_ = RegExp.rightContext);) switch(_[0]){ |
This file contains hidden or 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
exit unless `git config --get remote.origin.url` =~ /(\d+)\.git$/ | |
system "cmd /c start http://gist.github.com/#$1" | |
puts $1 |
This file contains hidden or 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
CmdUtils.CreateCommand({ | |
name: 'sort tabs', | |
description: 'Sorts tabs in the current window.', | |
author: {name: 'satyr', email: 'murky.satyr\100gmail.com'}, | |
license: 'MIT', | |
icon: 'chrome://ubiquity/skin/icons/favicon.ico', | |
arguments: { | |
object: CmdUtils.NounType('method', { | |
'by title': function(t) t.linkedBrowser.contentTitle, | |
'by host': function(t) t.linkedBrowser.currentURI.host, |
This file contains hidden or 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
[Adblock Plus 1.1] | |
! Checksum: BlImKQME9/j2KtuDsTRkTw | |
@@|http://storehouse.quickvps.net/ | |
@@|http://www.ustream.tv/ | |
@@|http://acid3.acidtests.org/ | |
@@|https://www.google.com/analytics/ | |
@@|https://www.google.com/reader/view/|$document | |
/\bad(?:s|click)?\b/ | |
/\banalytics(?=[./])/i | |
|http://*w3schools.com/banners/ |
This file contains hidden or 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 topsy auto more | |
// @namespace http://d.hatena.ne.jp/murky-satyr | |
// @include http://topsy.com/* | |
// ==/UserScript== | |
addEventListener('scroll', function f(){ | |
function stop(){ removeEventListener('scroll', f, false) } | |
try { | |
let a = document.querySelector('#more-bucket-more a'); | |
if(!a || /\b0\b/.test(a.textContent)) return stop(); |
This file contains hidden or 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 casecmd(fn) CmdUtils.CreateCommand({ | |
name: fn.name +' case', | |
description: 'Makes text '+ fn.name +' case.', | |
icon: icon(fn('Aa')), | |
argument: noun_arb_text, | |
execute: function case_execute({object: {text, html}}){ | |
if(!text) return; | |
var t = fn(text); | |
CmdUtils.setSelection(fn(html), {text: t}) || CmdUtils.copyToClipboard(t); | |
}, |
This file contains hidden or 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
# coding: utf-8 | |
require 'mathn' | |
class PICalc | |
def initialize name, parties | |
@name = name | |
@parties = parties | |
@total = parties.values.inject :+ | |
@perms = parties.to_a.permutation.to_a | |
end |