Skip to content

Instantly share code, notes, and snippets.

@basyura
basyura / gist:2860510
Created June 2, 2012 23:39
neco-tweetvim
function! s:source.get_complete_words(cur_keyword_pos, cur_keyword_str)
let keywords = map(tweetvim#cache#get('hash_tag'),
\ "{ 'word' : v:val, 'menu' : '[tweetvim]' }")
return neocomplcache#keyword_filter(keywords, a:cur_keyword_str)
endfunction
@basyura
basyura / gist:2509074
Created April 27, 2012 13:13
jscomplete
diff --git a/autoload/neocomplcache/sources/jscomplete.vim b/autoload/neocomplca
index 8388ec9..70f8b8a 100644
--- a/autoload/neocomplcache/sources/jscomplete.vim
+++ b/autoload/neocomplcache/sources/jscomplete.vim
@@ -22,6 +22,16 @@ function s:source.get_keyword_pos (cur_text) "{{{
return jscomplete#GetCompletePosition(a:cur_text, line('.'))
endfunction "}}}
function s:source.get_complete_words (pos, complWord) "{{{
+
+ let completion_length = neocomplcache#get_completion_length('jscomplete')
@basyura
basyura / hide_description.js
Created January 20, 2012 00:09
hide desctiption of hatena-bookmark for keysnail
style.register(<><![CDATA[
@-moz-document url-prefix("http://b.hatena.ne.jp/") {
.entry-summary, .entry-data {display:none}
.entry-comment-fold, .others {background-color:white}
.entry-image {width:32px;height : 32px;}
.entry-image-block {display:none;}
.trigger {display:none;}
}
]]></>.toString(), style.XHTML);
@basyura
basyura / yahoo_redirect.user.js
Created November 6, 2011 12:04
yahoo redirector
// ==UserScript==
// @name yahoo news redirector
// @namespace yahoo.news@basyura.org
// @include http://dailynews.yahoo.co.jp/*
// ==/UserScript==
(function () {
var h3 = document.getElementsByTagName("h3")[0];
var url = h3.childNodes[0].getAttribute("href");
location.href = url;
@basyura
basyura / gist:1339878
Created November 4, 2011 17:12
oauth.vim - diff
$ git diff
diff --git a/autoload/oauth.vim b/autoload/oauth.vim
old mode 100644
new mode 100755
index a9ffcfe..85f8ff2
--- a/autoload/oauth.vim
+++ b/autoload/oauth.vim
@@ -82,12 +82,18 @@ function! oauth#get(url, ctx, ...)
for key in keys(params)
let query[key] = params[key]
@basyura
basyura / gist:1339348
Created November 4, 2011 13:44
oauth.vim - failed
let s:consumer_key = 'consumer key'
let s:consumer_secret = 'consumer secret'
let s:access_token = 'access token'
let s:access_token_secret = 'access token secret'
let s:ctx = {
\ 'consumer_key' : s:consumer_key ,
\ 'consumer_secret' : s:consumer_secret ,
\ 'access_token' : s:access_token ,
@basyura
basyura / progress.vim
Created November 2, 2011 08:23
progress bar
"***************************************************
try
:0d | call append(0 , '"*')
for val in range(50)
sleep 10m
:0
let bar = expand("<cword>") . '*'
:0d
call append(0, bar)
@basyura
basyura / textile.vim
Created September 15, 2011 07:10
textile's outline
"=============================================================================
"
" outline for textile
"
" Licensed under the MIT license:
" http://www.opensource.org/licenses/mit-license.php
"
"=============================================================================
function! unite#sources#outline#defaults#textile#outline_info()
@basyura
basyura / javadoc_incremental_search.user.js
Created September 8, 2011 04:33
javadoc_incremental_search
// ==UserScript==
// @name Javadoc Incremental Search
// @namespace http://basyura.org
// @description Incremental search for Javadoc Class names.
// @include */allclasses-frame.html
// ==/UserScript==
//
// version 0.1
//
// original :
@basyura
basyura / 2ch_sender.user.js
Created September 8, 2011 04:31
2ch sender
// ==UserScript==
// @name 2chsend
// @namespace 2chsend@basyura.org
// @include http://2ch.xn--o9j0bk.gaasuu.com/entry/*
// ==/UserScript==
var a = document.evaluate("//div[@class='yui-g entry-full']/div/h2/a" ,
document ,
null ,
XPathResult.FIRST_ORDERED_NODE_TYPE ,
null).singleNodeValue;