Skip to content

Instantly share code, notes, and snippets.

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
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>'))
@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>
@atton
atton / .gitattributes
Created November 26, 2012 13:15
.gitattributes example
.gitignore export-ignore
@atton
atton / gist:4275788
Created December 13, 2012 11:09
custom cd in zsh
function cd() {
if [ $# -eq 0 ]; then
builtin pushd $HOME
else
builtin cd $@
fi
}
@atton
atton / .classpath
Created December 31, 2012 09:35
.classpath added jar in jdk
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/Library/Java/JavaVirtualMachines/jdk1.7.0_10.jdk/Contents/Home/jre/lib/jfxrt.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
@atton
atton / convert.rb
Last active December 12, 2015 02:38
VLSIなアレ
# vim:set fileencoding=utf-8:
Point = 5 # 固定小数点の位置
def convert_2_to_10 bit_array
# 2進数複素数列から10進数複素数へ変換。
# bit_array は [String] を想定。Stringはsize1。
real_sign, real = convert_sign_2(bit_array[0..15])
imaginary_sign, imaginary = convert_sign_2(bit_array[16..32])
@atton
atton / match.rb
Created February 21, 2013 12:53
2013/02/20 な Okinawa.rb の 正規表現でキャプチャしたのを変数に入れたりマッチオブジェクトにしたりなアレ
# vim:set fileencoding=utf-8:
string = "http://www.example.com/hoge/fuga"
/(?<protocol>[a-z]+):\/\/(?<server>[^\/]*)\/(?<path>.*)/ =~ string
p [protocol, server, path] # => ["http", "www.example.com", "hoge/fuga"]
m = /(?<protocol>[a-z]+):\/\/(?<server>[^\/]*)\/(?<path>.*)/.match(string)
p m
#=> #<MatchData "http://www.example.com/hoge/fuga" protocol:"http" server:"www.example.com" path:"hoge/fuga">
@atton
atton / aoj_0008.rb
Last active December 15, 2015 05:49
AOJ 0008
# after 1.9.2
while n = gets.chomp
puts (0..9).to_a.repeated_permutation(4).to_a.map{|a| a.inject(:+)}.select{|b| b == n.to_i}.size
end
@atton
atton / hoge.rb
Created March 28, 2013 10:38
ryudai.rb 005 謎の素数
(0..Float::INFINITY).lazy.select{|a| (a % 2 != 0) && (a % 3 != 0)}.take(1000).to_a.last