This file contains hidden or 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
# hisotry | |
HISTFILE=$HOME/.history # 履歴をファイルに保存する | |
HISTSIZE=10000000 # メモリ内の履歴の数 | |
SAVEHIST=10000000 # 保存される履歴の数 | |
setopt hist_ignore_dups # 重複を記録しない | |
setopt hist_ignore_all_dups | |
setopt hist_save_no_dups | |
setopt hist_reduce_blanks # スペース排除 | |
setopt extended_history # 履歴ファイルに時刻を記録 | |
setopt share_history # 端末間の履歴を共有 |
This file contains hidden or 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
#export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) | |
export LANG=en_US.UTF-8 | |
export LC_CTYPE=en_US.UTF-8 | |
export PATH=$PATH:$PWD/bin | |
export PATH=$PATH:$PWD/go/bin/ | |
export PATH="/usr/local/sbin:$PATH" | |
export PATH="/Users/aileron/go/bin:$PATH" | |
export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH" | |
export MECAB_PATH=/usr/local/Cellar/mecab/0.996/lib/libmecab.dylib | |
export EDITOR=vim |
This file contains hidden or 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
" vim-bootstrap b0a75e4 | |
"***************************************************************************** | |
"" Vim-PLug core | |
"***************************************************************************** | |
if has('vim_starting') | |
set nocompatible " Be iMproved | |
endif | |
let vimplug_exists=expand('~/.vim/autoload/plug.vim') |
This file contains hidden or 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
import sys | |
import os | |
import datetime | |
import subprocess | |
from keyhac import * | |
def configure(keymap): | |
keymap_terminal = keymap.defineWindowKeymap( app_name="com.googlecode.iterm2" ) # iterm2だけのローカル設定 | |
keymap_terminal["Ctrl-J"] = "104" # CTRL-Jを入力するとかなを送信。104はかなキーの仮想キーコード |
This file contains hidden or 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] | |
unstage = reset HEAD | |
delete-merged-branches = !git branch --merged | grep -v \\* | xargs git branch -d | |
delete-remote-branches = !git fetch --all --prune | |
delete-local-branches = !git branch | grep -v \\* | xargs git branch -D | |
delete-all-branches = !git delete-local-branches && git delete-remote-branches |
This file contains hidden or 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 'time' | |
wd = ["日", "月", "火", "水", "木", "金", "土"] | |
result = {} | |
while line = gets | |
begin | |
time = Time.parse(line) | |
date = time.strftime '%Y-%m-%d' | |
result[date] ||= [] |
This file contains hidden or 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
# frozen_string_literal: true | |
module ActiveStorageDownloader | |
refine ActiveStorage::Blob do | |
def download_to(tempdir: nil, &block) | |
DownloadTo.new(self, tempdir: tempdir).download_blob_to_tempfile(&block) | |
end | |
end | |
using self |
This file contains hidden or 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
class HasManyPrefetch | |
attr_reader :name | |
attr_reader :values | |
attr_reader :method_name | |
attr_reader :fetcher | |
def initialize(name:, method_name: nil, &fetcher) | |
@name = name | |
@method_name = method_name || "#{name}_id" | |
@fetcher = fetcher |
This file contains hidden or 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 'rails_helper' | |
module ValidateForAllRouting | |
class << self | |
# Admin配下のpath名と、それに合致するcontroller名とaction名を取得 | |
def admin_routes(actions) | |
routes = routes(actions) | |
routes.select { |route| route[:name].include?('admin') } | |
end | |
private |
This file contains hidden or 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
#!/usr/bin/env zsh | |
if [ $# -eq 0 ]; then | |
echo "Usage:" | |
echo "git wip (branch-name) (issue-number)" | |
exit 2 | |
fi | |
issue_number='' | |
issue_title='' | |
branch_name=$1 | |
if [ $# -eq 2 ]; then |