Skip to content

Instantly share code, notes, and snippets.

Satoshi Murakami satyr

Block or report user

Report or block satyr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fff.bml.js
/*
javascript:FetchFullFeed:['http://gist.github.com/15651.txt',function(d,i,e){for(i=this.length;--i;d.body.appendChild(e))e=d.createElement('script'),e.src=this[i]].reverse()[0](document)
*/
with(document)!function(){
var list = body.insertBefore(createElement('ul'), body.firstChild);
list.style.cssText =
('position:fixed; top:5px; left:5px; z-index:999999;'+
'text-align:left; background-color:menu; color:menutext;'+
'width:auto; height:auto; max-height:none; max-width:none;'+
'margin:0; padding:5px; font:normal 14px monospace;'+
View doukaku209.groovy
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] }
View gist:19338
(defun show-bytes () (interactive)
(let ((fn (get-buffer-file-name)))
(message (concat "buffer: ~D"
(if fn (format nil " file: ~D" (file-length fn)) ""))
(buffer-size))))
(global-set-key #\C-b 'show-bytes)
View google-one-touch.user.js
// ==UserScript==
// @name google-one-touch
// @description Adds keyboard shortcuts to each entry.
// @namespace http://d.hatena.ne.jp/murky-satyr
// @include http://www.google.tld/*
// ==/UserScript==
var splinks = document.getElementById('mbEnd');
if(splinks) splinks.parentNode.removeChild(splinks);
addEventListener('load', function onload(){
View cMenuOpener.uc.js
(function addURIOpenerToCMenu(opts){
var mi = document.createElement('menuitem');
mi.setAttribute('label', opts.label);
mi.setAttribute('accesskey', opts.accesskey);
mi.opener = opts.opener;
mi.run = function run(){
var {path, args} = this.opener;
with(gContextMenu) var uri = isTextSelected
? getSelectedURI()
: (onLink ? linkURI : gBrowser.currentURI).spec;
View wedatajsoninput.user.js
// ==UserScript==
// @name WedataJSONInput
// @namespace http://d.hatena.ne.jp/murky-satyr
// @description Fills the form by prompting json text.
// @include http://wedata.net/databases/*/items/new
// @include http://wedata.net/items/*/edit
// ==/UserScript==
with(document) with(getElementById('item').appendChild(createElement('a'))){
href = 'javascript:';
innerHTML = '<b>[JSON]</b>';
View gist:21615
(defun run-console () (interactive)
(launch-application
"cmd /k clear&&title cmd&&prompt $P$S[$D$S$T]$S$M$_$+$G$S"))
(defvar *last-command-cmd* "")
(defun command-cmd (cmd) (interactive "e> " :history0 'execute)
(execute-shell-command
(substitute-string (setq *last-command-cmd* cmd)
"\\?\\?" (or (get-buffer-file-name)
(buffer-name (selected-buffer))))
View gist:21641
(defvar *twitter-auth* "user:pass")
(defun twitter-update-with-curl (stat) (interactive "sTwitter: ")
(let ((twit "-d source=curl http://twitter.com/statuses/update.json")
(stat (si::www-url-encode (map-internal-to-utf-8 stat)
nil "-0-9A-Za-z._~")))
(message "~D" (execute-shell-command
(format nil "curl -s -u ~A -d status=~A ~A"
*twitter-auth* stat twit)))))
(global-set-key #\C-\\ 'twitter-update-with-curl)
View yats.ubiq.js
+function(pq, list){
const Yats = 'http://pcod.no-ip.org/yats/';
CmdUtils.CreateCommand({
name: "yats",
icon: 'http://twitter.com/favicon.ico',
takes: {'search formula': noun_arb_text},
modifiers: {'in': noun_type_language},
description: 'yet another twitter search'.link(Yats),
execute: function(inp, mod){ Utils.openUrlInBrowser(makeQ(inp, mod)) },
preview: function(pbl, inp, mod){
@satyr
satyr / jamazon.ubiq.js
Last active May 12, 2016
amazon.co.jp (Ubiquity 0.5.4+)
View jamazon.ubiq.js
var Name = 'jamazon',
Jamazon = 'http://www.amazon.co.jp/',
ItemMax = 35,
Logo = '<a class="logo" href="'+ Jamazon +'" accesskey="0">'
+ '<img border="0" width="126" height="28" align="middle" src="'
+ 'http://g-ecx.images-amazon.com/images/G/09/gno/images/general/'
+ 'navAmazonLogoFooter._V28243234_.gif'
+ '"/></a>',
Base = '<style>\
.head {padding:0 0.4em}\
You can’t perform that action at this time.