Skip to content

Instantly share code, notes, and snippets.

View maeharin's full-sized avatar

Hidenori Maehara maeharin

View GitHub Profile
@maeharin
maeharin / gist:4689138
Created February 1, 2013 04:10
自分用、頻出linux(リナックス)コマンド
tree -aF
@maeharin
maeharin / gist:4727153
Last active August 14, 2024 16:23
gitでコミットログを逆順(古い方から)表示する : git log first commit tail initial reverse
git log --reverse
# show branch tag etc
git log --reverse --decorate
@maeharin
maeharin / gist:4981915
Created February 19, 2013 00:09
linux date 日付 ファイル名 保存
touch $(date +%Y-%m-%d-%H-%M).bak
@maeharin
maeharin / gist:4993397
Last active May 29, 2022 12:45
du 直下のディレクトリの総計のみ表示(サイズが大きい順)
du -sh ./* | sort -nr
@maeharin
maeharin / composite.rb
Last active December 14, 2015 18:48
composite pattern
class D
attr_accessor :name, :elements
def initialize; yield self; end
def print
puts "#{@name}/"
elements.each {|e| e.print}
end
end
class F
lines = [
['user_code', 'sex', 'zangyo', 'q1', 'q2'],
['0001', '1', 'none', '1', '3'],
['0002', '1', 'none', '1', '3'],
['0003', '1', 'none', '1', '3'],
['0004', '1', 'none', '1', '3'],
['0005', '1', 'none', '1', '3']
]
heads = lines.shift.map(&:to_sym)
@maeharin
maeharin / gist:5d2b51fbe7150e67a979
Created May 18, 2014 06:53
gemがインストールされている場所に移動
$ cd $(bundle show activerecord)
@maeharin
maeharin / .bashrc
Created August 24, 2014 04:57
macにctagsインストールして、vimでRailsのソースコード読む ref: http://qiita.com/maeharin/items/9f98c0d63ab764ee21a8
alias ctags="`brew --prefix`/bin/ctags"
import UIKit
let code: String = "0001"
let num = code.toInt()! + 100
println(num)
// ---
let user_datas = [
@maeharin
maeharin / sh.md
Last active September 18, 2018 07:09
[sh]シェルスクリプトお手本