Skip to content

Instantly share code, notes, and snippets.

@satyr
satyr / google++.ubiq.js
Last active March 12, 2022 18:06 — forked from satyr/google-keynav.ubiq.js
google++
Utils.extend(feed, {
title: 'google++',
author: {
name: 'satyr', email: 'murky.satyr\x40gmail.com',
homepage: 'http://satyr.github.com',
},
license: 'X',
})
const
Google = 'https://www.google.com/',
@satyr
satyr / test2.js
Created January 23, 2009 10:08 — forked from Constellation/test2.js
<script>alert=0</script>
alert("test2");
@satyr
satyr / yats.ubiq.js
Created January 11, 2009 01:04 — forked from satyr/yats.ubiq.js
yet another twitter search <http://pcod.no-ip.org/yats/>
const Name = 'yats',
Yats = 'http://pcod.no-ip.org/yats/',
Base = ''+ <div class={Name}><base href={Yats}/><style><![CDATA[
h2 {margin:0; padding:0}
img {width:16px; height:16px; border:none}
ol {margin:2px 0; padding:0}
li {float:left; clear:left; width:100%; padding:0 0 4px 0}
li div {float:left; padding-right:2px}
h2, p {clear:left; font-size:84%}
kbd {text-decoration:underline; vertical-align:top}
String fun(String fpath, List mods, Closure sorter){
def r = new File(fpath).text.trim().split(/\r?\n/)*.tokenize('\t')
mods.each{ r.(it.maximumNumberOfParameters==2?'eachWithIndex':'each') it }
[r.head(), *r.tail().sort(sorter)]*.join('\t').join('\n')
}
print fun('data.csv', [
{ it[0..3] = it[0, 2, 1, 3] },
{ a, i -> if(i){ [0, 3].each{ a[it] = a[it].toInteger() }; ++a[3] } },
]){ it[0] }