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
require 'win32ole' | |
def each_meeting | |
ol = WIN32OLE.connect("Outlook.Application") | |
myNameSpace = ol.getNameSpace("MAPI") | |
folder = myNameSpace.GetDefaultFolder(9) # 9 は予定表 | |
#folder.Display | |
folder.Items.each do |meeting| | |
GC.start | |
yield meeting |
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
require 'win32ole' | |
require 'kconv' | |
require 'csv' | |
require 'date' | |
class Ticket | |
attr_reader :id | |
attr_reader :subject | |
attr_reader :from | |
attr_reader :to |
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
sqlplus -s << EOF > ${sdata_file} | |
${ora_user_name}/${ora_user_pass}@${ora_sid} | |
set echo off | |
set linesize 1000 | |
set pagesize 0 | |
set trimspool on | |
set trimout on | |
set feedback off | |
set colsep ',' |
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
require 'rubygems' | |
require 'icalendar' | |
require 'date' | |
cal = Icalendar::Calendar.new | |
cal.event do | |
dtstart DateTime.new(2010, 05, 19, 22, 00), {'TZID' => 'Asis/Tokyo'} | |
dtend DateTime.new(2010, 05, 19, 22, 30), {'TZID' => 'Asis/Tokyo'} | |
summary "うちあわせ" | |
end |
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
@echo off | |
ruby -S -x %0 %* | |
goto end | |
#! ruby | |
# some ruby code | |
__END__ | |
:end | |
pause |
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
//all job name | |
jenkins.model.Jenkins.instance.items.each { | |
println "Job: ${it.name}" | |
} | |
//method list of Jenkins instance | |
jenkins.model.Jenkins.instance.class.methods.each { | |
println "Jenkins method: ${it.name}" | |
} |
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
//refs http://d.hatena.ne.jp/thata/20100213/1265987041 | |
UIAlertView *alert = [[UIAlertView alloc] | |
initWithTitle:@"hoge" | |
message:textfield.text | |
delegate: nil | |
cancelButtonTitle:@"OK" | |
otherButtonTitles:nil]; | |
[alert show]; | |
[alert release]; |
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
@echo off | |
ruby -S -x %0 %* | |
goto end | |
#! ruby | |
require 'win32/clipboard' # before install "win32-clipboard" gem | |
pattern = ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a | |
puts "Random String => " + Array.new(8){pattern[rand(pattern.size)]}.join | |
Win32::Clipboard.set_data(value, Win32::Clipboard::UNICODETEXT) | |
puts "Stored to clipboard" |
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
def print_tree(base_dir) | |
base_dir = base_dir + '/' unless base_dir.end_with? '/' | |
size = 0 | |
Dir.glob("#{base_dir}*/") do |dir| | |
#puts "entering #{dir}" | |
size += print_tree dir | |
end | |
Dir.glob("#{base_dir}*") do |file| | |
real_size = File.size file | |
size += compute_actual_size real_size |
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
//Dump from mysql | |
/* dump ファイルが文字化けしたので コマンドラインから sqldump したほうがよさそう | |
def mysqldump_process = "/path/to/mysqldump -u redmine -psecret redmine".execute() | |
new File("redmine.dump").withWriter { writer -> | |
writer << mysqldump_process.text | |
} | |
*/ | |
//Archive dump and attachedfiles | |
new AntBuilder().zip(destfile: "path/to/backup/redmine-backup." + new Date().format("yyyyMMddHHmmss") + ".zip", |
OlderNewer