- 行末のセミコロンが不要
ASI じゃないので「不要」は語弊。
- インデントで関数定義のブロックを表現する
「関数定義の」が余計。
// ==UserScript== | |
// @name mondradelhelper | |
// @description Helps you delete redundant normal/bronze cards. | |
// @match http://w001.monsterdragon.jp/card/index | |
// @author satyr | |
// @version 0.2 | |
// ==/UserScript== | |
var actions, header, target, action; | |
actions = { | |
Dups: function(){ |
<!DOCTYPE html> | |
<form method=POST target=result | |
action=http://w001.monsterdragon.jp/connect/web/login/flash/summons/do> | |
<input type=hidden name=summon_id value=1> | |
<input type=submit> | |
<iframe name=result style=width:99%></iframe> |
/* | |
// ==UserScript== | |
// @id mdmu_satyr | |
// @name mondraminiurl | |
// @version 0.1 | |
// @namespace http://satyr.github.com | |
// @author satyr | |
// @description Minifies the deck URL, copying it if possible. | |
// @include http://w001.monsterdragon.jp/deck/index* | |
// ==/UserScript== |
{Fun, Unary} = Coco.ast | |
uplus = -> it instanceof Unary and it.op is \+ | |
<- Coco.on \compile | |
<- it.ast.traverseChildren ..., true | |
# +-> | |
if uplus it and (fun = it.it) instanceof Fun | |
delete it[k] for k in it | |
fun = it <<< {fun.__proto__, ...fun} |
for(n<-0 to 99)println(Seq(n+1,"Buzz","Fizz","FizzBuzz")(n%3&2|n%5/4)) |
function lookup obj, key | |
if obj? | |
obj = Object obj | |
do | |
return that if Object.getOwnPropertyDescriptor(obj, key)?[@] | |
while obj = Object.getPrototypeOf obj | |
void | |
<[G S]>forEach -> Object"lookup#{it}etter" = lookup.bind it.toLowerCase() + \et |
- 行末のセミコロンが不要
ASI じゃないので「不要」は語弊。
- インデントで関数定義のブロックを表現する
「関数定義の」が余計。
uniqMap: 25ms | |
uniqOld: 337ms | |
-- | |
on Firefox 7.01 |
Coco.on \compile ({ast}) -> dig ast | |
function dig | |
if it..displayName is \Block and it.lines.0?value is '"use overload"' | |
it.traverseChildren pick, true | |
return | |
it.eachChild dig | |
function pick | |
it <<< {compile} if it..displayName is \Op and it.second |