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 -*- | |
require 'mechanize' | |
class AmazonOrder | |
def initialize | |
@agent = WWW::Mechanize.new | |
@agent.user_agent_alias = 'Windows IE 7' | |
end | |
def login id, password |
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 -*- | |
require 'mechanize' | |
require 'uri' | |
class DokushoMeter | |
def initialize | |
@agent = WWW::Mechanize.new | |
@agent.user_agent_alias = 'Windows IE 7' | |
end |
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
var items = [2,7,1,5,1,2,4,65,76,874,3,2,1,3,7,1,5,1,2,4,65,76,874,3,2,1,3] | |
var table = [] | |
items.forEach(function(n){ | |
console.log(table); | |
table = table.concat(table.map(function(x){return x + n}).concat(n)) | |
}) | |
table.filter(function(x){return x <= 10}).sort(function(x,y){return x < y})[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
#!/bin/ruby | |
class Item | |
include Comparable | |
attr_accessor :value, :route | |
def initialize v | |
@value = v | |
@route = [] | |
end |
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
#!/bin/ruby | |
class Item | |
include Comparable | |
attr_accessor :value, :route | |
def initialize v | |
@value = v | |
@route = [] | |
end |
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
# -*- encoding: utf-8 -*- | |
require 'rexml/document' | |
require 'net/http' | |
class Keyphrase | |
def initialize | |
path = File.join(File.dirname(__FILE__), "..", "config", "yahooapis.yml") | |
config = YAML::load(File.open(path)) | |
@app_id = config['app_id'] | |
end |
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
# -*- encoding: utf-8 -*- | |
require 'rexml/document' | |
require 'net/http' | |
class MA | |
def initialize | |
path = File.join(File.dirname(__FILE__), "..", "config", "yahooapis.yml") | |
config = YAML::load(File.open(path)) | |
@app_id = config['app_id'] | |
end |
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 "mechanize" | |
password = '' | |
domain = '' | |
agent = WWW::Mechanize.new | |
page = (agent.get 'http://ddo.jp/') | |
form = page.forms.with.name('dnsupdate').first |
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
# dm-rails付きのrailsでプロジェクトを作成. | |
rails new rails_example -m http://datamapper.org/templates/rails.rb | |
cd rails_example | |
# cucumebr等を追加. 2010/10/31現在のgemはバグがあるため野良gitから取得. | |
cat > gemfile.patch | |
--- Gemfile 2010-10-31 11:25:20.286666717 +0900 | |
+++ Gemfile 2010-10-31 11:23:19.700000054 +0900 | |
@@ -36,8 +36,10 @@ | |
gem 'dm-observer', DM_VERSION | |
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
rails generate scaffold article title:string body:text | |
rails generate cucumber:feature article title:string body:text | |
rake db:setup RAILS_ENV=test | |
rake features |