Skip to content

Instantly share code, notes, and snippets.

@atton
atton / pom.xml
Created November 6, 2012 07:00
pom.xml example
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>hoge</groupId>
<artifactId>hoge</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
l <Down> *@eskk#filter(eskk#util#key2char('<Down>'))
l <Up> *@eskk#filter(eskk#util#key2char('<Up>'))
l <PageDown> *@eskk#filter(eskk#util#key2char('<PageDown>'))
l <PageUp> *@eskk#filter(eskk#util#key2char('<PageUp>'))
l <BS> *@eskk#filter(eskk#util#key2char('<BS>'))
l <C-E> *@eskk#filter(eskk#util#key2char('<C-E>'))
l <C-G> *@eskk#filter(eskk#util#key2char('<C-G>'))
l <C-H> *@eskk#filter(eskk#util#key2char('<C-H>'))
l <Tab> *@eskk#filter(eskk#util#key2char('<Tab>'))
l <CR> *@eskk#filter(eskk#util#key2char('<CR>'))
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 3 2012 20:47:17)
MacOS X (unix) version
Included patches: 1-673
Compiled by username@hostname
Huge version without GUI. Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
-clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs
-dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path
+find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv
{
'args': '',
'cmdopt': '',
'command': 'ruby',
'exec': '%c %o -c %s:p',
'hook/hier_update/enable_exit': 1,
'hook/output_config/enable_module_loaded': '1',
'hook/output_config/log': '1',
'hook/quickfix_replate_tempname_to_bufnr/enable_exit': 1,
'hook/quickfix_replate_tempname_to_bufnr/priority_exit': -10,
\ "watchdogs_checker/ruby" : {
\ "command" : "ruby",
\ "exec" : "%c %o -c %s:p",
\ "quickfix/errorformat" : "%E%f:%l:\ %m",
\ },
@atton
atton / make.txt
Created September 26, 2012 13:25
watchdogsrun
:compiler ruby
:make -c %
した時のquickfix
hoge.rb|1 error| syntax error, unexpected '{', expecting '\n' or ';'
hoge.rb|2 error| unterminated string meets end of file
@atton
atton / next.rb
Created August 28, 2012 08:47
next test
# 0 から 5 まで出力
(0..5).each do |num|
if num == 3
next # 3だけ飛ばす
end
puts num
end
@atton
atton / hash_and_array.rb
Created August 26, 2012 11:33
hash and array
# -*- coding: utf-8 -*-
# ハッシュの中に配列
array_in_hash = {:hoge => [1,2] , :fuga => [3,4]}
# keyを渡すと配列が返ってくる
p array_in_hash[:hoge] # => [1, 2]
# その配列の0番目
p array_in_hash[:hoge][0] # => 1
@atton
atton / puts_hash.rb
Created August 25, 2012 13:50
メソッドへの {} 渡し
# -*- coding: utf-8 -*-
# method { ... } だと
# ブロックを渡してるのかハッシュを渡してるのか、ってなるので
# ハッシュを渡したい時は {} を省略して良いらしい
def puts_hash_hoge hash
puts hash[:hoge]
end
puts_hash_hoge :hoge => "hogehoge" , :fuga => "fugafuga"
@atton
atton / gist:3360562
Created August 15, 2012 14:23
ruby settings
.vimrcにこの行を追加
autocmd BufNewFile *.rb 0r ~/.vim/templates/ruby.rb "ruby
~/.vim/templates/ruby.rb に下の行だけのファイルを作る
# -*- coding: utf-8 -*-