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
| Given /^(?:すべてのメールをクリアする|メールボックスが空になっている)$/ do | |
| reset_mailer | |
| end | |
| # Use this step to open the most recently sent e-mail. | |
| When /^メールを開く$/ do | |
| open_email(current_email_address) | |
| end | |
| When /^"([^']*?)" のメールを開く$/ do |address| |
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 'rubygems' | |
| require 'twitter' | |
| user = "" | |
| pass = "" | |
| httpauth = Twitter::HTTPAuth.new(user, pass) | |
| base = Twitter::Base.new(httpauth) | |
| friends = base.friends.size |
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
| # use moro-miso | |
| # sudo gem install moro-miso | |
| # http://d.hatena.ne.jp/moro/20090603/1244042258 |
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
| class OauthController < ApplicationController | |
| require 'oauth' | |
| require 'json' | |
| def self.consumer | |
| OAuth::Consumer.new("Consumer key","Consumer secret", {:site => "http://twitter.com"}) | |
| end | |
| def verify | |
| request_token = OauthController.consumer.get_request_token( |
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
| access_token = OAuth::AccessToken.new(OauthController.consumer, @user.token, @user.secret_token) | |
| res = access_token.post('/statuses/update.json', {:status => "oauth test"}) |
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 | |
| # coding: utf-8 | |
| require 'fileutils' | |
| PATH = "/Users/uk/local/bin" | |
| RUBY_VER = ["1.9.2", "1.8.7"] | |
| CMD = ["ruby", "irb", "gem"] | |
| version = ARGV.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
| class Sample | |
| def public_method | |
| "public" | |
| end | |
| private | |
| def private_method | |
| "private" | |
| end | |
| 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
| class Sample: | |
| def __private_method(self): | |
| print "private" | |
| return None | |
| sample = Sample() | |
| # sample.__private_method() | |
| # AttributeError | |
| sample._Sample__private_method() |
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
| (define (main args) | |
| (print "Hello, World") | |
| 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
| (define (main args) | |
| (use srfi-1) | |
| (map | |
| (lambda (x) (cond [(= (modulo x 15) 0) "FizzBuzz"] | |
| [(= (modulo x 5) 0) "Buzz"] | |
| [(= (modulo x 3) 0) "Fizz"] | |
| [else x])) | |
| (iota 100 1)) | |
| ) |