Skip to content

Instantly share code, notes, and snippets.

View aileron's full-sized avatar

AILERON aileron

View GitHub Profile
@aileron
aileron / .zshrc.prompt
Last active July 16, 2018 15:43
cool prompt
# 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
@aileron
aileron / .zshrc
Last active July 16, 2018 15:43
.zshrc 2018
eval "$(rbenv init -)"
export PATH=$PATH:$PWD/bin
source .zshrc.history
source .zshrc.prompt
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
@aileron
aileron / .tmux.conf
Created January 17, 2018 01:12
.tmux.conf vi mode
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"
@aileron
aileron / git-wip.sh
Last active October 6, 2017 08:06
github wip flow
#!/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"
@aileron
aileron / link_to_active.rb
Created May 22, 2017 23:58
link_to_active
@aileron
aileron / flatten_attributes.rb
Last active March 21, 2017 12:55
Nokogiri でパースしたオブジェクトの xpath 列挙
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)
[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
@aileron
aileron / pokemoji.yml
Created September 2, 2016 08:47
pokemon-go-jpn
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
#自己紹介 @aileron
こんにちわ 芦沢昌彦(あしざわまさひこ)です
#職業
* ちっさな会社の代表 エンジニア 何でもするつもり!
#【初参加】なんで Ruby をはじめようと思ったの?
* 複数の言語の勉強をしている時に!
#Rails 4 と GitHub に関するステータス
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