Skip to content

Instantly share code, notes, and snippets.

View aileron's full-sized avatar

AILERON aileron

View GitHub Profile
[core]
excludesfile = /Users/aileron/.gitignore_global
[user]
name = aileron.cc
email = [email protected]
[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
@aileron
aileron / gist:8610113
Created January 25, 2014 01:01
ぬるぽを、ガってする。
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
/**
* ガってする
*/
public class NullPoInterceptor implements MethodInterceptor
{
@Override
public Object invoke(final MethodInvocation invocation) throws Throwable
@aileron
aileron / gist:4733884
Created February 7, 2013 20:26
Ruby on rails markdown( Redcarpet ) used view helper
module MarkdownHelper
_markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML,
:autolink => true, :space_after_headers => true)
define_method :markdown do |text|
raw _markdown.render(text)
end
end
.entypo-phone:before { content: "\1F4DE"; }
.entypo-mobile:before { content: "\1F4F1"; }
.entypo-mouse:before { content: "\E789"; }
.entypo-address:before { content: "\E723"; }
.entypo-mail:before { content: "\2709"; }
.entypo-paper-plane:before { content: "\1F53F"; }
.entypo-pencil:before { content: "\270E"; }
.entypo-feather:before { content: "\2712"; }
.entypo-attach:before { content: "\1F4CE"; }
.entypo-inbox:before { content: "\E777"; }
@aileron
aileron / gist:3402037
Created August 20, 2012 07:59
Ruby1.9 で Shift_JIS 風 UTF-8 と CP932 風 UTF-8 の正規化
# ruby1.9 で正規化して、エンコードするまで
"なんかきもいやつら".
tr("\u{301C 2016 2212 00A2 00A3 00AC 2014 00A6}","\u{FF5E 2225 FF0D FFE0 FFE1 FFE2 2015 FFE4}").encode("sjis")
@aileron
aileron / gist:3367643
Created August 16, 2012 07:17
キターぐるぐる。
/**
jquery.glance.js ver1.0
The MIT License
Copyright (c) since 2012 Grow! inc. jun takeno
http://about.me/yamitake
http://twitter.com/yamitake
Permission is hereby granted, free of charge, to any person obtaining a copy
@aileron
aileron / gist:3177543
Created July 25, 2012 17:58
ステートマシーンのRuby実装 ほぼ AASMと同じ使い方。
module StateMachine
class Event
def transition opt={from:nil,to:nil,guard:nil}
self.ts ||= {}
self.ts[ opt[:from] ] = opt if (opt[:from].is_a? String) || (opt[:from].is_a? Symbol)
opt[:from].each do |name|
ts[name] = opt
end if opt[:from].is_a? Array
end
attr_accessor :ts