Skip to content

Instantly share code, notes, and snippets.

@kei-s
kei-s / smartGoToParent.js
Created September 30, 2010 13:50
Smart Go Parent Plugin #vimperator
var PLUGIN_INFO =
<VimperatorPlugin>
<name>{NAME}</name>
<description>Smart Go Parent</description>
<description lang="ja">賢く上位ディレクトリに移動</description>
<author mail="[email protected]" homepage="http://twitter.com/kei_s">kei-s</author>
<version>0.1</version>
<minVersion>2.3</minVersion>
<maxVersion>2.4</maxVersion>
<updateURL>http://gist.github.com/raw/604592/smartGoToParent.js</updateURL>
@kei-s
kei-s / smart_go_parent.js
Created September 29, 2010 12:15
Smart Go Parent #vimperator
(function(){
// thanks to http://trac.arantius.com/browser/extension/uppity/content/uppity.js
let regexp = new RegExp('([a-z]+://)([^/]*)(/.*)');
let goUpPath = function(path) {
if (!path) return;
path = path.replace(/\/$/,'').replace(/^\/+/,'');
if (path.indexOf('#')>0) {
return path.replace(/#.*/,'');
}
if (path.indexOf('?')>0) {
@kei-s
kei-s / prevent_pseduo_domain.js
Created September 28, 2010 12:36
Prevent jump to pseudo domain #vimperator
(function(){
liberator.registerObserver('enter',function(){
let tldStr = "(?:museum|travel|aero|arpa|coop|info|jobs|name|nvus|biz|com|edu|gov|int|mil|net|org|pro|xxx|ac|ad|ae|af|ag|ai|ak|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|ct|cu|cv|cx|cy|cz|dc|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fl|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hi|hk|hm|hn|hr|ht|hu|ia|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|ks|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mi|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|nd|ne|nf|ng|nh|ni|nj|nl|nm|no|np|nr|nu|ny|nz|oh|ok|om|or|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ri|ro|ru|rw|sa|sb|sc|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tx|tz|ua|ug|uk|um|us|ut|uy|uz|va|vc|ve|vg|vi|vn|vt|vu|wa|wf|wi|ws|wv|wy|ye|yt|yu|za|zm|zw)"
let regexp = new RegE
@kei-s
kei-s / oauth_token_maker.rb
Created September 24, 2010 08:55
oauth token maker
# vim:fileencoding=utf-8
require 'rubygems'
require 'oauth'
require 'pit'
config = Pit.get("tweetstream_oauth",:require => {
"consumer_key" => "Set Consumer Key",
"consumer_secret" => "Set Consumer Secret",
})
@kei-s
kei-s / Gemfile
Created July 7, 2010 12:11
user streams with oauth
source 'http://rubygems.org'
gem 'em-http-request', :require => 'em-http'
gem 'oauth'
gem 'pit'
gem 'yajl-ruby', :require => 'yajl'
@kei-s
kei-s / Imagerotation.user.js
Created June 7, 2010 09:11 — forked from june29/Imagerotation.user.js
Rotate Images (patched)
// ==UserScript==
// @name Rotate Images
// @namespace http://june29.jp/
// @include *
// ==/UserScript==
(function() {
var style = document.createElement('style');
document.body.appendChild(style);
style.textContent = "img, canvas, video {\n" + "-moz-transform: rotate(0deg);\n" + " }";
@kei-s
kei-s / heat_the_nicovideo_up.user.js
Created May 15, 2010 15:36
Heat the nicovideo up (patched)
//// -*- mode: javascript; coding: utf-8 -*-
// ==UserScript==
// @name Heat the nicovideo up
// @author noriaki
// @namespace http://blog.fulltext-search.biz/
// @description Visualize comments upsurge for Nicovideo
// @license MIT License
// @version 0.4.0
// @released 2007-09-11 09:00:00
// @updated 2009-06-07 19:58:00
@kei-s
kei-s / gist:393139
Created May 7, 2010 06:29
install mecab with ruby
$ wget http://downloads.sourceforge.net/project/mecab/mecab/0.98/mecab-0.98.tar.gz
$ tar zxvf mecab-0.98.tar.gz
$ cd mecab-0.98
$ ./configure
$ make
$ make check
$ sudo make install
$ wget http://downloads.sourceforge.net/project/mecab/mecab-ipadic/2.7.0-20070801/mecab-ipadic-2.7.0-20070801.tar.gz
$ tar zxvf mecab-ipadic-2.7.0-20070801.tar.gz
@kei-s
kei-s / .gitignore
Created April 21, 2010 07:13
user streams to AMQP
mongodb/*
@kei-s
kei-s / nicovideo_username_in_my.user.js
Created April 14, 2010 19:03
Nicovideo username in mylist
// ==UserScript==
// @name Nicovideo username in mylist
// @namespace http://libelabo.jp/
// @include http://www.nicovideo.jp/openlist/*
// @require http://gist.github.com/3238.txt
// ==/UserScript==
(function(){
function addUserName(node) {
var lists = $X('.//strong',node);