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 'openssl' | |
require 'base64' | |
# 以下は自分で作ったテスト用鍵(password:test) | |
key = "-----BEGIN PUBLIC KEY----- | |
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5FXW2ILwLtuzTZyftaBX | |
47C5kvQk0q+qBB8iuTOoJawrgE5lzspDYJSwA8fPtbzAdxooNUTMdyv6SVWj1vH2 | |
SWP3M0KH9LzyQJlxoS03GoRpw8XHNWZr5+JClcBEuUiAp09B9pLR3i+kX4vzc1+z | |
1LRLCwBLq8BiL+lSf1mDNrMKi8pSzsYHk1TTPeQuRjCRip6rQFvr1Gllj+ZrCir4 | |
q3z77/7xbE23JdbqB9wmXUhKHcIlO5nwVnczkdz0d6OL4vU7F9feRoMGDXCKq7ZZ |
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
# https://github.com/alloy/terminal-notifier | |
# | |
# via. | |
# https://github.com/kern/minitest-reporters/blob/master/lib/minitest/reporters/base_reporter.rb | |
module Minitest | |
module Reporters | |
class NotificationReporter < Minitest::StatisticsReporter | |
attr_accessor :tests |
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 'diff/lcs' | |
require 'diff/lcs/string' | |
require 'digest/md5' | |
require 'fileutils' | |
require 'shellwords' | |
@project_name = "hogehoge" | |
watch( 'test/test_.*\.rb' ) {|md| system("rake test") } |
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 'rubygems' | |
require 'activerecord' | |
ActiveRecord::Base.establish_connection( | |
:adapter => "mysql", | |
:host => "192.168.***.***", | |
:username => "username", | |
:password => "password", | |
:database => "database", | |
:socket => "/var/lib/mysql/mysql.sock", |
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
test |
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
OpenIdAuthentication.store = OpenID::Store::ActiveRecord.new | |
# | |
# https://github.com/openid/ruby-openid/issues#issue/1 | |
# | |
module OpenID | |
class Consumer | |
class CheckIDRequest | |
def get_message(realm, return_to=nil, immediate=false) | |
if !return_to.nil? |
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
class OpenidController < ApplicationController | |
def start | |
identifier = "https://mixi.jp" | |
if using_open_id?(identifier) | |
open_id_authentication(identifier) | |
end | |
end | |
def open_id_authentication(identifier) | |
authenticate_with_open_id(identifier, |
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
mkdir -p controller1/admin/test | |
mkdir -p controller2/admin/test | |
mkdir -p controller3/admin/test | |
mkdir -p controller1/user/test | |
mkdir -p controller1/user/mail | |
touch controller1/admin/test/1.txt | |
touch controller1/user/test/1.txt | |
touch controller1/user/mail/1.xml | |
touch controller2/admin/test/2.txt | |
touch controller3/admin/test/3.txt |
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
== app/controllers/weocome_controller.rb == | |
class WelcomeController < ApplicationController | |
include Jpmobile::ViewSelector | |
#hankaku_filter #:input => true | |
hankaku_filter :input => true | |
trans_sid | |
def index | |
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
openssl enc -d -aes-256-cbc -in encrypted -k jiji -base64 | |
# -*- coding: utf-8 -*- | |
require 'openssl' | |
require 'base64' | |
text = 'rirakkuma' * 80 * 30000 | |
pass = "jiji" |
OlderNewer