git diff
- -M オプション
- ファイル名変更のチェック
- -M オプション
git shortlog
- コミッタごとにログ表示
- -s オプション
- 作成者名とコミット数のみ
- -n オプション
- コミット数で降順ソート
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
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
require 'net/http' | |
require 'uri' | |
require 'json' | |
CREATE_NOTE_URI = 'https://api.catch.com/v3/streams/default' | |
USER = 'username' | |
PASS = 'password' |
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
# char -> int | |
p "A".ord | |
#=> 65 | |
# int -> char | |
p 1.chr() | |
#=> "\x01" |
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
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
MEMORY_SIZE = 30000 | |
ASCII_SIZE = 256 | |
def parse(code) | |
memory = [] | |
MEMORY_SIZE.times do | |
memory << 0 |
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
[Desktop Entry] | |
Encoding=UTF-8 | |
Name=Eclipse | |
Comment=Eclipse IDE | |
Exec=/usr/local/eclipse/eclipse | |
Icon=/usr/local/eclipse/icon.xpm | |
Terminal=false | |
Type=Application | |
Categories=GNOME;Application;Development; | |
StartupNotify=true |
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
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
require 'nokogiri' | |
def divide(filename) | |
gpx = Nokogiri::XML(File.read(filename)) | |
segment_count = gpx.xpath('//xmlns:trkseg').length | |
segment_count.times do |i| |
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
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
module GpxDistance | |
def calc_gpx_distance(gpx_file) | |
gpx = File.open(gpx_file) { |f| f.read } | |
latlons = [] | |
gpx.each_line { |line| latlons << [$1.to_f, $2.to_f] if line =~ /<trkpt lat="([0-9.]+)" lon="([0-9.]+)">/ } |
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
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
require 'open-uri' | |
require 'nokogiri' | |
URL_BASE = "http://store.tsutaya.co.jp/item/rental_cd" | |
def check_stock(product_id, store_id) | |
url = "#{URL_BASE}/#{product_id}.html?storeId=#{store_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
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
require "thor" | |
require "term/ansicolor" | |
DAILY_MEMO_DIR = ENV["HOME"] + "/Dropbox/memo/daily/" | |
class DailyCli < Thor | |
desc "edit [NAME]", "Edit memo in Emacs", aliases: "e" |
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
#!/usr/bin/env ruby | |
root = Dir.pwd | |
Dir.glob("*").map { |d| File.expand_path(d, root) }.each do |dir| | |
next unless File.ftype(dir) == "directory" | |
Dir.chdir(dir) | |
unpushed = `git rev-list origin/master..master 2>/dev/null | wc -l | tr -d ' '`.to_i | |
puts "#{dir} [#{unpushed}]" if unpushed > 0 | |
end |
OlderNewer