This file contains hidden or 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 'csv' | |
require 'rexml/document' | |
xml = REXML::Document.new() | |
xml.add(REXML::XMLDecl.new("1.0", "UTF-8")) | |
root =REXML::Element.new("urlset") | |
root.add_namespace("http://www.sitemaps.org/schemas/sitemap/0.9") | |
xml.add_element(root) |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="jetpack" href="jetpackTesting.js" /> | |
<title>testing Jetpack</title> | |
</head> | |
<body> | |
<h1>testing Jetpack</h1> | |
</body> | |
</html> |
This file contains hidden or 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 'rubygems' | |
require 'sinatra' | |
require 'appengine-apis/memcache' | |
before do | |
@memcache = AppEngine::Memcache.new | |
end | |
get '/test/:key' do | |
@key = params[:key] |
This file contains hidden or 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 -*- | |
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 |
This file contains hidden or 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 | |
target = gets.to_i | |
count = gets.to_i | |
values = {} | |
count.times do |i| | |
values[gets.to_i] = 1 | |
end | |
answer = 0 |
This file contains hidden or 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 '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 | |
ActiveRecord::Base.establish_connection(:test) |