Skip to content

Instantly share code, notes, and snippets.

View jiikko's full-sized avatar
🦑

jiikko jiikko

🦑
View GitHub Profile
@jiikko
jiikko / gist:f2a94ffe6436db48d912
Created May 29, 2013 05:28
.zshrc for minimam
alias ls='ls -F --color=auto'
bindkey -e
export PS1="${USER}@${HOST}:%~%# "
zstyle ':completion:*:default' menu select=1
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}'
autoload -U compinit
compinit
HISTFILE=$HOME/.zsh-history
HISTSIZE=100000
@jiikko
jiikko / capybara cheat sheet
Created September 15, 2013 11:39 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
require 'csv'
def import_spots(model: nil, csv_obj: nil, except_column: nil)
header = csv_obj.shift
csv_obj.each do |row|
record = Hash[header.zip(row)]
next if record["ページ名(名称)"].nil? # 空行を無視する
record.except!(except_column)
binding.pry rescue (:1 + 1)
<td><%= t("helpers.label.block.#{block.status}") %></td>
let s = "jii" . "kko"
let a = split(s, "kk")
echo a
let list = [1, 2, 3]
echo list[0]
let dict = { 'a': 123, 'b': 987}
echo dict["a"]
let counter = 0
inoremap <expr> <C-L> ListItem()
inoremap <expr> <C-R> ListReset()
func! ListItem()
call cursor(line("."), 1)
let g:counter += 1
let texts = split(getline(line(".") -1), '\.')
if len(texts) == 2
let tmp_text = ""
func! SayHoi()
" グローバルな変数をsplitして無関係な文字を返す
split(g:tmp_text, ".")
echo("ko")
return "koko"
endfunc
" 現在の行の.でsplitする
let texts = split(getline("."), ".")
[14] pry(#<RSpec::Core::ExampleGroup::Nested_1::Nested_4>)> JSON.parse(Spot.last.to_json)
=> {"id"=>11,
"title"=>"スポット0000000011",
"traffic_route"=>"MyString",
"address"=>"MyString",
"address_area"=>nil,
"kana"=>"MyString",
"tel"=>"MyString",
"powered_by"=>"MyString",
"control_by"=>nil,
#!/bin/sh
find ./ -type f -name "*.html" | while read i
do
nkf -w $i > $i._backup
done
find ./ -type f -name "*._backup" | while read i
do