This file contains 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
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 |
This file contains 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
=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') |
This file contains 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 '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) |
This file contains 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
binding.pry rescue (:1 + 1) |
This file contains 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
<td><%= t("helpers.label.block.#{block.status}") %></td> |
This file contains 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
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"] |
This file contains 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
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 |
This file contains 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
let tmp_text = "" | |
func! SayHoi() | |
" グローバルな変数をsplitして無関係な文字を返す | |
split(g:tmp_text, ".") | |
echo("ko") | |
return "koko" | |
endfunc | |
" 現在の行の.でsplitする | |
let texts = split(getline("."), ".") |
This file contains 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
[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, |
This file contains 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
#!/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 |
OlderNewer