This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" set number | |
let g:setnumber = "on" | |
function Setnumber(setnumber) | |
if a:setnumber == "on" | |
let g:setnumber = "off" | |
set nonumber | |
else | |
let g:setnumber = "on" | |
set number | |
endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" set number | |
function Setnumber() | |
if &number | |
setlocal nonumber | |
else | |
setlocal number | |
endif | |
endfunction | |
nnoremap <C-m> :call Setnumber()<CR> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/local/bin/ruby | |
require 'kconv' | |
LENGTH = 3 | |
COUNT = 5 | |
ines = File.read('/home/<USERNAME>/.bash_history').toutf8.split("\n") | |
lines_uq = lines.uniq | |
rethash = Hash.new | |
lines_uq.each do |line| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Good Bye! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/local/bin/ruby | |
#coding: utf-8 | |
### requires ################################################## | |
require 'twitter' | |
require 'uri' | |
require 'open-uri' | |
require 'open_uri_redirections' | |
require 'nokogiri' | |
############################################################### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SETLOCAL enabledelayedexpansion | |
SET command=convert -append | |
for %%f in (*.png) do ( | |
SET command=!command! %%f | |
) | |
SET command=%command% output.png | |
call %command% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- [python] @: デコレータ | |
- Python - デコレータ http://www17.atpages.jp/~lambda7/py/decorator.html | |
- Pythonのデコレータを理解するための12Step http://qiita.com/_rdtr/items/d3bc1a8d4b7eb375c368 | |
デコレータとは「関数を引数に取り, 引き換えに新たな関数を返すcallable(*)」。 | |
より分かりやすく言えば「@wrapperで指定したwrapper(func)な関数で、直下の関数に機能追加できる」機能。 | |
もとの関数funcの引数は「*args, **kwargs」で利用可。 | |
=================================================== | |
import time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gem install win32-api | |
※参考 http://stackoverflow.com/questions/14220386/ruby-win32-api-getfocus-and-getwindowtext | |
require 'win32/api' | |
include Win32 | |
while true do | |
hwnd = GetActiveWindow = API.new('GetForegroundWindow', 'V', 'L', 'user32').call | |
GetWindowText = API.new('GetWindowText', 'LPI', 'I', 'user32') | |
GetWindowTextLength = API.new('GetWindowTextLength', 'L', 'I', 'user32') | |
buf_len = GetWindowTextLength.call(hwnd) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fssm' | |
watch_dir = '~/watch_action' | |
def create_action(base, file) | |
puts 'hoge' | |
end | |
def update_action(base, file) | |
puts 'hoge' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### mecab, ruby-mecab導入 | |
http://sourceforge.jp/projects/sfnet_mecab/downloads/mecab/0.97/mecab-0.97.tar.gz/ | |
$ sudo rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm | |
$ sudo yum install mecab | |
$ sudo yum install mecab-devel | |
$ sudo rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm | |
$ sudo yum install -y groonga-tokenizer-mecab | |
「$ mecab -v」でバージョンを確認して、 | |
同じバージョンのmecab-rubyをダウンロードする(バージョンが違うとmake出来ないので注意) | |
$ wget http://mecab.googlecode.com/files/mecab-ruby-0.996.tar.gz |
OlderNewer