Skip to content

Instantly share code, notes, and snippets.

View vividtone's full-sized avatar

MAEDA Go vividtone

View GitHub Profile
@vividtone
vividtone / find_by_status_history.rb
Created September 21, 2011 05:27
Redmineのチケットのうち、特定のステータスに設定されたことがあるものを検索して一覧表示する。
# encoding: utf-8
# find_by_status_history.rb
#
# Redmineのチケットのうち、特定のステータスに設定されたことがある
# チケットを検索します。
#
# 使い方:
# Redmineのインストールディレクトリで以下のように実行。
#
@vividtone
vividtone / gist:1273173
Created October 9, 2011 01:45
open some iTerm tabs and execute commands with AppleScript
set workdir to "~"
tell application "iTerm"
activate
set myterm to (make new terminal)
tell myterm
launch session "Default Session"
tell the last session
set name to "session 1"
write text "cd " & workdir
@vividtone
vividtone / new_iterm_tab.scpt
Created October 10, 2011 01:31
open new iTerm tab and change directory.
#!/usr/bin/osascript
# open new iTerm tab and change directory.
set current_dir to do shell script "pwd"
tell application "iTerm"
tell application "System Events"
tell process "iTerm" to keystroke "t" using command down
end tell
tell the current terminal
tell the last session
write text "cd " & current_dir
@vividtone
vividtone / issue_creations.rb
Created October 28, 2011 06:44
Redmineのチケット作成の履歴を表示
# encoding: utf-8
# issue_creations.rb
#
# Redmineのチケット作成の履歴を表示
#
# 使い方:
# Redmineのインストールディレクトリで以下のように実行。
#
# script/runner -e production issue_creations.rb
@vividtone
vividtone / issue_updates.rb
Created October 28, 2011 06:45
Redmineのチケット更新の履歴を表示
# encoding: utf-8
# issue_updates.rb
#
# Redmineのチケットに対する更新の一覧を日付順に表示します。
#
# 使い方:
# Redmineのインストールディレクトリで以下のように実行。
#
# cript/runner -e production issue_updates.rb
@vividtone
vividtone / issue_creations_report.rb
Created October 28, 2011 06:46
Redmineの日ごとのチケット作成件数を表示
# encoding: utf-8
# issue_creations_report.rb
#
# Redmineのチケットの日ごとの作成数を表示
#
# 使い方:
# Redmineのインストールディレクトリで以下のように実行。
#
# script/runner -e production issue_creations_report.rb
@vividtone
vividtone / issue_updates_report.rb
Created October 28, 2011 06:48
Redmineの日ごとのチケット更新回数を表示
# encoding: utf-8
# issue_updates_report.rb
#
# Redmineのチケットの日ごとの更新数を表示
#
# 使い方:
# Redmineのインストールディレクトリで以下のように実行。
#
# script/runner -e production issue_updates_report.rb
@vividtone
vividtone / gist:1385200
Created November 22, 2011 08:41
Redmine: add validations to exsiting models.
module AddIssueValidation
def self.included(base)
base.class_eval do
validates_presence_of :category
validates_presence_of :due_date
validates_presence_of :fixed_version
end
end
end
@vividtone
vividtone / gist:1388047
Created November 23, 2011 06:51
空のディレクトリもgitリポジトリに含める
find . -type d -exec touch {}/.gitkeep \;
git init
git add --all
@vividtone
vividtone / gist:1531282
Created December 29, 2011 02:28
start a web server from the current directory
ruby -e 'require "webrick"; s = WEBrick::HTTPServer.new(:Port => 3000, :DocumentRoot => "./"); trap("INT") {s.shutdown} ; s.start'