Skip to content

Instantly share code, notes, and snippets.

Kimihiko NAKAMURA konk303

View GitHub Profile
konk303 / test-queue.rb
Last active Jul 6, 2017
Simplified test-queue runner with simplecov
View test-queue.rb
#!/usr/bin/env ruby
require 'test_queue'
require 'test_queue/runner/rspec'
class MyAppTestRunner < TestQueue::Runner::RSpec
def after_fork(num)
SimpleCov.command_name "worker#{num}"
ActiveRecord::Base.configurations['test']['database'] << num.to_s
View fixture_load_patch.rb
# -*- coding: utf-8 -*-
module ActiveRecord
module ConnectionAdapters # :nodoc:
module DatabaseStatements
# == rake db:fixture:load のmonkey patch
# 既存のfixture yamlに下記の問題がある
# # 型的に不正な初期値を使用してる箇所がある (sql_mode TRADITIONAL では落ちる)
# # NOT NULL制約のあるカラムに値をセットしていない時がある (sql_mode TRADITIONAL では落ちる)
# # 日付・時間カラムに、システム最小日付(lws_time)が入らない
# ので、ActiveRecord::ConnectionAdapters::DatabaseStatements.insert_fixture
View memcached_test.rb
require 'rubygems'
require 'sinatra'
require 'appengine-apis/memcache'
before do
@memcache =
get '/test/:key' do
@key = params[:key]
konk303 / jetpackTesting.html
Created May 22, 2009
testing jetpack feature
View jetpackTesting.html
<!DOCTYPE html>
<link rel="jetpack" href="jetpackTesting.js" />
<title>testing Jetpack</title>
<h1>testing Jetpack</h1>
konk303 / createSitemap.rb
Created May 22, 2009
learning ruby; file, csv, xml
View createSitemap.rb
#!/usr/bin/env ruby
require 'csv'
require 'rexml/document'
xml =
xml.add("1.0", "UTF-8"))
View solve.rb
#!/usr/bin/env ruby
target = gets.to_i
count = gets.to_i
values = {}
count.times do |i|
values[gets.to_i] = 1
answer = 0
You can’t perform that action at this time.