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
#!/bin/sh | |
echo "Clean Services" | |
echo "Clean User" | |
dscl localhost -delete /Local/Default/Users/firebird | |
echo "Clean Group" | |
dscl localhost -delete /Local/Default/Groups/firebird | |
if [ -f "/Library/StartupItems/Firebird" ]; then | |
echo "Remove SuperServer StartupItem" | |
rm -fr /Library/StartupItems/Firebird | |
fi |
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 "rubygems" | |
require "amqp" # requires version >= 0.8.0.RC14 | |
puts "=> Example of automatic AMQP channel and queues recovery" | |
puts | |
AMQP.start(:host => "localhost") do |connection, open_ok| | |
puts "AMQP.start block runs" | |
# on_open, on_closedに渡されたブロックは、何度再接続をしても最初の一度だけしか呼び出されないが、 |
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 | |
# Usage: gemspec [-s] GEMNAME | |
# | |
# Prints a basic gemspec for GEMNAME based on your git-config info. | |
# If -s is passed, saves it as a GEMNAME.gemspec in the current | |
# directory. Otherwise prints to standard output. | |
# | |
# Once you check this gemspec into your project, releasing a new gem | |
# is dead simple: | |
# |
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
obj = Object.new | |
def obj.foo(*args) | |
options = args.last.is_a?(Hash) ? args.pop : {} | |
options = {:name=>"A", :no=>1}.update(options) | |
"#{args.inspect} #{options.inspect}" | |
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
require 'java' | |
require 'poi-3.1-FINAL-20080629.jar' | |
class RubyOutputStream < java.io.OutputStream | |
def set_io(io) | |
@io = io | |
end | |
def write(b) | |
if b.is_a?(Fixnum) |
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 'java' | |
require 'poi-3.1-FINAL-20080629.jar' | |
java.io.FileOutputStream.new("test2.xls") do |io| | |
wb = org.apache.poi.hssf.usermodel.HSSFWorkbook.new | |
wb.createSheet("First") | |
wb.write(io) | |
end |