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
/** | |
* A Bad Knowhow for CakePHP 1.1.x | |
* | |
* force rewriting `default' setting | |
* because libs/session.php has hard-coded `default' ! | |
*/ | |
class DATABASE_CONFIG { | |
var $default = array( 'driver' => 'XXXXX', | |
'connect' => 'XXXXX', | |
'host' => 'XXXXX', |
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
# | |
# always retry | |
# | |
# ex) | |
# do_with_retry( 'dns' ) { Resolv.getaddress( 'example.com' ) } | |
# | |
def do_with_retry( name, &block ) | |
times = RETRY_LIMIT | |
begin | |
block.call |
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
# -*- coding: utf-8 -*- | |
=begin | |
agent = EzDebug_Mechanize.new( :debug => true, | |
:page_dir => /path/to/dir ) { |a| | |
a.log = Logger( '/path/to/logfile' ) | |
a.log.level = Logger::DEBUG | |
} | |
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
# -*- coding: utf-8 -*- | |
require 'pty' | |
require 'expect' | |
=begin | |
ssh & su example for expect.rb | |
variables |
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
# -*- mode: ruby; coding: utf-8 -*- | |
require 'hpricot' | |
require 'open-uri' | |
=begin | |
required configuration | |
set :package, { |
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
Object::Diff::LCS.diff( lines_array, lines_array ).each { |d| | |
d.each { |c| | |
puts c.to_a.to_s | |
} | |
} |
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
BEGIN:VEVENT | |
... | |
BEGIN:VALARM | |
TRIGGER;VALUE=DURATION:-P1D | |
DESCRIPTION:イベント | |
ACTION:DISPLAY | |
END:VALARM | |
END:VEVENT | |
COMMENT:iCalのアラームの基本形 |
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
class FooExcept < StandardError; end | |
task :default do | |
raise FooExcept, 'bar' | |
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
diff --git a/plugin/calendar_viewer.inc.php b/plugin/calendar_viewer.inc.php | |
index cafc33b..874d899 100644 | |
--- a/plugin/calendar_viewer.inc.php | |
+++ b/plugin/calendar_viewer.inc.php | |
@@ -68,6 +68,7 @@ function plugin_calendar_viewer_convert() | |
$limit_page = 0; // サーチするページ数 | |
$mode = 'past'; // 動作モード | |
$date_sep = '-'; // 日付のセパレータ calendar2なら '-', calendarなら '' | |
+ $ignore_blockplugin = false; | |
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
# | |
# Usage: vcat [-v ofs=<OFS>] <file1> [file2] ... | |
# | |
# Cannot specify field of file. Use cut command instead. | |
# | |
BEGIN { | |
if ( ofs ) { | |
OFS = ofs | |
} else { |