Skip to content

Instantly share code, notes, and snippets.

View arika's full-sized avatar
🍡 ☕️ 🍰 ☕️ ☕️ ☕️ ☕️

akira yamada arika

🍡 ☕️ 🍰 ☕️ ☕️ ☕️ ☕️
View GitHub Profile
@arika
arika / tdiary-export.rb
Created November 12, 2008 09:19
exports tDiary data ad HTML text
#!/usr/bin/ruby
#
# this script dumps diary data from tDiary 2.2.x.
#
# usage: $0 /path/to/tdiary/dir [/path/to/tdiary.conf/dir] > tdiary.dat
#
# Author: akira at arika.org
# License: tDiary's
config_override = proc do |config|
@arika
arika / tdiary2typo.rb
Created November 12, 2008 09:53
imports data generated by tddump.rb to typo.
#!/usr/bin/ruby
#
# this script imports dump data of tDiary 2.2.x to Typo 5.1.x.
# (ref: http://gist.github.com/24118)
#
# usage: /path/to/typo-base-dir/script/runner tdiary2typo.rb /path/to/tdiary.dat
#
# Author: akira at arika.org
# License: Ruby's
@arika
arika / gonzui-rack.rb
Created November 23, 2008 04:35
rackup gonzui
# gonzui <http://gonzui.sf.net> wrapper for Rack
unless defined?(GONZUIRC)
GONZUIRC = File.expand_path('~/.gonzuirc')
end
require 'gonzui'
require 'gonzui/webapp'
class GonzuiWEBrickServletApp
# reload anoter version of RubyGems
lp0 = $:.dup
ENV["GEM_HOME"] = "/tmp/GEM"
$:.unshift "REL_1_1_1/lib"
p require "rubygems" #=> true
p Gem::RubyGemsVersion #=> "1.1.1"
gem "rails"
lp1 = $:.dup
@arika
arika / 書籍「プログラミング言語Ruby」とRuby 1.9.1RC2のNEWSファイルの対応状況
Created January 29, 2009 13:56
書籍「プログラミング言語Ruby」とRuby 1.9.1RC2のNEWSファイルの対応状況
書籍「プログラミング言語Ruby」と
Ruby 1.9.1RC2のNEWSファイルの対応状況。
o - 記述あり
x - 記述なし
- - 対象範囲外
? - 未確認・判断できず
------------------------------------------------------------------------------
= NEWS
diff --git a/lib/capistrano/command.rb b/lib/capistrano/command.rb
index 8e0c61b..87a4c41 100644
--- a/lib/capistrano/command.rb
+++ b/lib/capistrano/command.rb
@@ -207,13 +207,15 @@ module Capistrano
if options[:shell] == false
shell = nil
+ shell, cmd = replace_environment(shell, cmd)
else
@arika
arika / gist:183708
Created September 9, 2009 13:28
re: gist:183701
pinned = Pin.find(:all,:conditions => [ 'pins.eid = last_modifieds.eid AND user_id = ?','arika' ], :joins => 'LEFT OUTER JOIN last_modifieds', :order => 'last_modifieds.date desc',:offset =>0,:limit => 10)
D,[22:27:06.977] Pin Load (0.0ms) Mysql::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE (pins.eid = last_modifieds.eid AND user_id = 'arika') ORDER BY last_modif' at line 1: SELECT `pins`.* FROM `pins` LEFT OUTER JOIN last_modifieds WHERE (pins.eid = last_modifieds.eid AND user_id = 'arika') ORDER BY last_modifieds.date desc LIMIT 0, 10
pinned = Pin.find(:all,:conditions => [ 'user_id = ?','arika' ], :joins => 'LEFT OUTER JOIN last_modifieds ON pins.eid = last_modifieds.eid', :order => 'last_modifieds.date desc',:offset =>0,:limit => 10)
D,[22:31:17.510] Pin Load (0.6ms) SELECT `pins`.* FROM `pins` LEFT OUTER JOIN last_modifieds ON pins.eid = last_modifieds.eid WHERE (user_id = 'arika') ORDER BY last_modifieds.date desc LIMIT 0, 10
@arika
arika / capistrano_upstream_helper.rb
Created October 3, 2009 00:33
An experimental helper. It makes Capistrano tasks that can refer its upstream hosts/roles
module UpstreamSupport
module Utils
def initialize(config)
@config = config
end
def to_ary
to_a
end
@arika
arika / auto_search.rb
Created October 26, 2009 01:27
termtter plugin: searches keywords automatically
# -*- coding: utf-8 -*-
config.plugins.auto_search.set_default(:keywords, [])
module Termtter::Client
public_storage[:auto_search] ||= {
:since_id => nil,
:keyword => {},
}