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
# Pure | |
# by Sindre Sorhus | |
# https://github.com/sindresorhus/pure | |
# MIT License | |
# change this to your own username | |
DEFAULT_USERNAME='sindresorhus' | |
# threshold (sec) for showing cmd exec time |
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
eval "$(rbenv init -)" | |
export PATH=$PATH:$PWD/bin | |
source .zshrc.history | |
source .zshrc.prompt | |
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh |
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
set-option -g default-terminal screen-256color | |
# set-option -g default-command "reattach-to-user-namespace -l zsh" | |
set -g terminal-overrides 'xterm:colors=256' | |
# Use vim keybindings in copy mode | |
setw -g mode-keys vi | |
# Setup 'v' to begin selection as in Vim | |
bind-key -T copy-mode-vi v send -X begin-selection | |
bind-key -T copy-mode-vi y send -X copy-pipe "reattach-to-user-namespace pbcopy" |
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 | |
if [ $# -eq 0 ]; then | |
echo "Usage:" | |
echo "git wip (branch-name) (issue-number)" | |
exit 2 | |
fi | |
issue_number='' | |
branch_name=$1 | |
if [ $# -eq 2 ]; then | |
branch_name="#$2_$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
# controller名でactiveを判断 | |
# controller_name or [controller_name] or current_page(root_path) | |
def link_to_active(href, condition, wrapper: 'li', **options, &block) | |
active = condition == true || | |
condition == controller.controller_name || | |
(condition.include?(controller.controller_name) if condition.is_a?(Array)) | |
wrapper_tag = wrapper | |
wrapper_class = '' | |
wrapper_tag, wrapper_class = wrapper.first if wrapper.is_a?(Hash) |
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
def flatten_attributes | |
objects = {} | |
stack = [] | |
stack << { name: '', object: html.at('body'), children: html.at('body').children.dup } | |
while stack.present? | |
parent = stack.last | |
obj = parent[:object] | |
name = parent[:name] | |
name += obj.name | |
name = "##{obj.attr(:id)}" if obj.attr(:id) |
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
[core] | |
excludesfile = /Users/aileron/.gitignore_global | |
[user] | |
name = aileron.cc | |
email = aileron.cc@gmail.com | |
[push] | |
default = simple | |
[alias] | |
delete-merged-branches = !git branch --merged | grep -v \\* | xargs git branch -d | |
delete-remote-branches = !git fetch --all --prune |
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
title: pokemon-prefix | |
emojis: | |
- name: pokemon-fushigidane | |
src: http://i.imgur.com/J9ynKU9.png | |
- name: pokemon-fushigiso | |
src: http://i.imgur.com/2BmEJY1.png | |
- name: pokemon-fushigibana | |
src: http://i.imgur.com/HyvH3iG.png | |
- name: pokemon-hitokage | |
src: http://i.imgur.com/je6nD3.png |
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
#自己紹介 @aileron | |
こんにちわ 芦沢昌彦(あしざわまさひこ)です | |
#職業 | |
* ちっさな会社の代表 エンジニア 何でもするつもり! | |
#【初参加】なんで Ruby をはじめようと思ったの? | |
* 複数の言語の勉強をしている時に! | |
#Rails 4 と GitHub に関するステータス |
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
class Array | |
def eql_all? &block | |
block = lambda {|a|a} unless block | |
max=self.length | |
i=0 | |
c = block.( self[i] ) | |
n = nil | |
result = while i+1<max | |
n=block.(self[i+1]) | |
break false unless c == n |