Skip to content

Instantly share code, notes, and snippets.

View pocke's full-sized avatar
⌨️
Pocke is typing...

Masataka Pocke Kuwabara pocke

⌨️
Pocke is typing...
View GitHub Profile
notice: /opt/mikutter/core/plugin/command/command.rb:264:in `focus_move_to_nearest_postbox': called: given widget #<Plugin::GUI::Tab(role=tab,slug=activity)>
notice: /opt/mikutter/core/plugin/command/command.rb:267:in `focus_move_to_nearest_postbox': found postbox: nil
@pocke
pocke / nyan.rb
Last active August 29, 2015 13:56
# にゃーんっぽい正規表現
/^([にみ][ゃゅょ][あぁ]*[ーっ]*ん?っ?)+$/
p STDIN.reject{|x| x =~ /^"/ or x =~ /^\s*\n/ or x =~ /^\s*\\/}.size
eval s="a = 1; def fac(n);n == 1 ? 1 : n*fac(n-1);end; $>.tty? ? puts(fac(a)) : puts('eval s='+s.inspect.sub(/([0-9]+)/){($1.to_i + 1).to_s})"
function auto_poke(){var sel = document.getElementsByClassName('selected'); for(var i = 0; i < sel.length; i++){var item = sel[i]; if(item.text == 'Pokeを返す'){item.click();} } setTimeout(auto_poke, 100); }; auto_poke();
```markdown
hoge
```
@pocke
pocke / def.rb
Created November 15, 2014 13:01
puts send def
def x =
def end x
x end
x end
@pocke
pocke / vimrc
Last active August 29, 2015 14:09
if has('vim_starting')
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
call neobundle#begin(expand('~/.vim/bundle/'))
NeoBundle 'haya14busa/incsearch.vim'
call neobundle#end()
filetype plugin indent on " Required!
@pocke
pocke / search.rb
Created November 27, 2014 13:44
Array#include?, Array#bsearch, Set#include? benchmark
require 'benchmark'
require 'set'
profile_init = false
def search_array(array, target)
array.include?(target)
end
def search_sorted_array(array, target)
(function () {
var url = window.location.href;
var regexp = /docs\.ruby-lang\.org\/ja\/([0-9.]+)/;
var latest_version = '2.1.0';
if (url.match(regexp) && RegExp.$1 != latest_version) {
var new_url= url.replace(RegExp.$1, latest_version);
window.location.href = new_url;
}
})();