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
/** | |
* Convert RFC1123-style time differences to N-seconds | |
* | |
* If unixtime is given, convert first it to RFC1123-style time | |
* differences by date( "O" ). | |
* | |
* @since 2008-10-03 | |
* @param string | |
* @return int | |
*/ |
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
Index: include/feedcreator.class.php | |
=================================================================== | |
--- include/feedcreator.class.php (revision 17) | |
+++ include/feedcreator.class.php (working copy) | |
@@ -521,6 +521,9 @@ | |
* @return string the truncated string | |
*/ | |
function iTrunc($string, $length) { | |
+ if (extension_loaded('mbstring')) { | |
+ return FeedCreator::iTrunc_mb($string, $length); |
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 | |
require 'rubygems' | |
require 'vpim/icalendar' | |
require 'open-uri' | |
require 'optparse' | |
$KCODE = 'u' | |
class Icat | |
def initialize |
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
index 1bf1d10..3716dee 100644 | |
--- a/lib/rest_client.rb | |
+++ b/lib/rest_client.rb | |
@@ -228,7 +228,7 @@ module RestClient | |
end | |
def response_log(res) | |
- "# => #{res.code} #{res.class.to_s.gsub(/^Net::HTTP/, '')} | #{(res['Content-type'] || '').gsub(/;.*$/, '')} #{res.body.size} bytes" | |
+ "# => #{res.code} #{res.class.to_s.gsub(/^Net::HTTP/, '')} | #{(res['Content-type'] || '').gsub(/;.*$/, '')} #{res.body ? res.body.size : 0} bytes" | |
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
<?php | |
/** | |
* page の内容をそのまま HTML に整形せずに返す | |
* | |
* @since 2008-12-17 | |
*/ | |
function plugin_raw_action() { | |
global $vars, $_title_invalidwn, $_msg_invalidiwn; | |
$page = isset( $vars['page'] ) ? $vars['page'] : ''; |
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 -*- | |
task :default do | |
sh 'rake -s -T', :verbose => false | |
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
<?php | |
/** | |
* Array Utils | |
* | |
* @since 2009-02-23 | |
*/ | |
if ( !function_exists( 'array_at' ) ) { | |
/** | |
* array の中の index の位置の値を返す |
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 | |
irb(main):001:0> Size.amount( '2GB' ) | |
=> 2000000000.0 | |
irb(main):002:0> Size.amount( '2GiB' ) | |
=> 2147483648.0 | |
LICENSE : two-clause BSD |
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 -*- | |
class Array | |
# | |
# classift( /()/ ) | |
# | |
# [ | |
# [grouped by same \1], | |
# [grouped by same \1], | |
# [grouped by same \1], |
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 | |
Mechanize debug 用の wrapper | |
LICENSE : two-clause BSD | |
=end | |
def get( uri ) | |
if ( @agent.log ) |
OlderNewer