Skip to content

Instantly share code, notes, and snippets.

View kaosf's full-sized avatar
🏠
Working from home

ka kaosf

🏠
Working from home
View GitHub Profile
@kaosf
kaosf / arrow-macro-diff.clj
Created August 18, 2013 14:19
A difference of between -> and ->> on Clojure 1.5.1
(->
1
((fn [x y] (+ x (* 10 y))) 2))
;-> 21
(->>
1
((fn [x y] (+ x (* 10 y))) 2))
;-> 12
@kaosf
kaosf / expand-arrow-macro.clj
Created August 18, 2013 16:45
Expand arrow macro on Clojure 1.5.1.
(macroexpand '(-> x (f1 y1) (f2 y2) (f3 y3)))
;-> (f3 (clojure.core/-> (clojure.core/-> x (f1 y1)) (f2 y2)) y3)
(macroexpand '(clojure.core/-> x (f1 y1)))
;-> (f1 x y1)
(macroexpand '(->> x (f1 y1) (f2 y2) (f3 y3)))
;-> (f3 y3 (clojure.core/->> (clojure.core/->> x (f1 y1)) (f2 y2)))
(macroexpand '(clojure.core/->> x (f1 y1)))
;-> (f1 y1 x)
@kaosf
kaosf / vim-setup.sh
Created September 15, 2013 02:46
for research Vim SEGV
mkdir -p ~/.vim/autoload
mkdir -p ~/.vim/bundle
cd ~/.vim/autoload
curl -so ~/.vim/autoload/pathogen.vim \
https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim
cd ~/.vim/bundle
git clone https://github.com/Shougo/neocomplcache.git --depth 1
# SHA1: a54079968b268e4fe8843290b23c410c1af619c5
@kaosf
kaosf / .vimrc
Created September 15, 2013 02:47
for research Vim SEGV
call pathogen#incubate()
call pathogen#infect()
let g:neocomplcache_enable_at_startup = 1
if !exists('g:neocomplcache_omni_patterns')
let g:neocomplcache_omni_patterns = {}
endif
let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::'
@kaosf
kaosf / ruby-setup.sh
Created September 16, 2013 03:48
for research Vim SEGV
sudo yum groupinstall development-tools
sudo yum install gcc-c++
sudo yum install openssl-devel zlib-devel readline-devel
# ref. https://github.com/kaosf/fedora-setup/blob/4c7cf06c5fb93ab9c8c40065e228966b415ef9e1/ruby-setup.sh
git clone https://github.com/sstephenson/rbenv.git $HOME/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> $HOME/.zshenv
echo 'eval "$(rbenv init -)"' >> $HOME/.zshenv
exec $SHELL -l
mkdir -p $HOME/.rbenv/plugins
{:user {:plugins [
[colorize "0.1.1"]
- [lein-exec "0.3.1"]]}}
+ [lein-exec "0.3.1"]]}
+ :jvm-opts ["-XX:+TieredCompilation"
+ "-XX:TieredStopAtLevel=1"
+ "-Xverify:none"]}
for i in \
fre_ll04 \
fre_l04 \
fre_m04 \
fre_s04 \
go_ll04 \
go_l04 \
go_m04 \
go_s04 \
ss_ll04 \
curl http://www.toei-anim.co.jp/ptr/precure/deco.html 2> /dev/null | \
grep "<a href=\"special\/" | \
ruby -e "STDIN.each_line do |l|
l.scan(/href=\"([^\"]*)\"/).flatten.each do |x|
puts x.slice(0, x.length - 4).split('/')[1]
end
end"
STDIN.each_line do |l|
l.scan(/href="([^"]*)"/).flatten.each do |x|
puts x.slice(0, x.length - 4).split('/')[1]
end
end