Skip to content

Instantly share code, notes, and snippets.

View saihoooooooo's full-sized avatar
♨️
noop

shinya.saiho saihoooooooo

♨️
noop
View GitHub Profile
@saihoooooooo
saihoooooooo / pad-attack-calc.rb
Created June 25, 2013 02:27
pad attack calculator
#!/usr/bin/ruby
attack = [
1575,
979,
1234,
1234 * 0.3,
800,
1336,
1080,
@saihoooooooo
saihoooooooo / timer.coffee
Last active December 18, 2015 18:49
Message timer for hubot.
# Description:
# alarm wo narase!!
#
# Commands:
# hubot timer <int> [<text>] - <int> byou go ni <text> wo hyouji
# hubot alarm 12:34 [<text>] - 12:34 ni <text> wo hyouji
module.exports = (robot) ->
robot.respond /timer (\d+) ?(.+)?/i, (msg) ->
time = msg.match[1] * 1000
@saihoooooooo
saihoooooooo / svn-status-all.rb
Last active December 18, 2015 16:29
sweep the directory in `svn status`.
#!/usr/bin/ruby
dir = File.dirname(__FILE__)
unless ARGV[0].nil?
dir = ARGV[0]
end
Dir.chdir(File.expand_path(dir)) {
Dir::foreach('.') { |f|
if FileTest::directory?(f + '/.svn') && !(['.', '..'].include?(f))
@saihoooooooo
saihoooooooo / gist:5697298
Created June 3, 2013 10:17
solrの部分UPDATE
curl 'localhost:8983/solr/collection/update?commit=true' -H 'Content-type:application/json' -d '[{"primary_id":"1234567890","price":{"set":100}}]'
@saihoooooooo
saihoooooooo / gist:5697296
Created June 3, 2013 10:16
カテゴリがAの時はmin_priceフィールドが0のものをそれ以外はmax_priceが0のものを抽出
fq={!frange l=0 u=0}if(exists(query({!v='category:A'})),min_price,max_price)
@saihoooooooo
saihoooooooo / gist:5589963
Created May 16, 2013 07:15
<C-o>でバッファを行ったり来たり
autocmd MyAutoCmd BufWinEnter * call s:PushBufstack()
function! s:PushBufstack()
if !exists('w:bufstack')
let w:bufstack = []
endif
if !exists('w:bufstack_pos')
let w:bufstack_pos = 0
endif
if exists('w:bufstack_move') && w:bufstack_move == 1
let w:bufstack_move = 0
@saihoooooooo
saihoooooooo / gist:5275329
Created March 30, 2013 04:17
Overwrite previous neobundle configuration
" 初期化
if has('vim_starting')
set runtimepath+=~/.vim/bundle/neobundle.vim
call neobundle#rc('~/.vim/bundle')
filetype plugin on
filetype indent on
endif
" plugin
NeoBundle 'git://github.com/Shougo/unite.vim.git'
@saihoooooooo
saihoooooooo / gist:4215594
Created December 5, 2012 13:43
implove f
" f/F強化版
" TODO 履歴を一つ戻って最後を消す
" TODO 他の箇所のdictの「 : 」を「: 」に直す
" TODO 他の箇所の色の16進表記を統一
" TODO 他の箇所のhighlightコマンドのterm/fg/bgの順番を統一
" TODO dropundoinfoのエラー表示方法を修正(エラー表示を関数化)
noremap <silent>f :call <SID>FHint(0)<CR>
noremap <silent>F :call <SID>FHint(1)<CR>
let g:fhint_hint_chars = [
\ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
@saihoooooooo
saihoooooooo / gist:4201880
Created December 4, 2012 08:39
Imploved ":earlier 4".
for i in range(4)
normal g-
endfor
" --------------------------------------------------------------------------------
" easymotionの不満
"
" ・UNDO履歴の破壊
" o
" |
@saihoooooooo
saihoooooooo / gist:4110000
Created November 19, 2012 10:27
neocomplcacheが固まる件
if has('vim_starting')
set runtimepath+=~/vimfiles/bundle/neobundle.vim
call neobundle#rc('~/vimfiles/bundle')
endif
NeoBundle 'git://github.com/Shougo/neocomplcache.git'
NeoBundle 'git://github.com/Shougo/vimproc.git'
let g:neocomplcache_enable_at_startup = 1