Skip to content

Instantly share code, notes, and snippets.

View ueno1969's full-sized avatar

Kazuhiko UENO ueno1969

View GitHub Profile
@ueno1969
ueno1969 / gist:3951372
Created October 25, 2012 08:16
Androidアプリをantでビルドするとき、パスワードの入力を隠す方法
パスワードをコマンドラインで入力するようにして、普通に ant release したら、入力したパスワードがコンソールに表示されたので、それを隠す方法
-----------------------------------------------------
build.xmlに以下を追加。
android SDKのtools/ant/build.xmlの一部を修正して、プロジェクトのbuild.xmlに追加
<target name="-release-prompt-for-password" if="has.keystore" unless="has.password">
<input
@ueno1969
ueno1969 / rack_request_url.txt
Created August 14, 2012 06:42
Rack::RequestのURL関連のメソッドの値
http://example.com:3000/foo/index.html?bar=1
のときのRack::Requestのメソッドの値
request.fullpath #=> "/foo/index.html?bar=1"
request.host #=> "example.com"
request.host_with_port #=> "example.com:3000"
request.path #=> "/foo/index.html"
request.path_info #=> "/index.html"
request.port #=> 3000
request.query_string #=> "bar=1"
@ueno1969
ueno1969 / mock_rr.rb
Created May 31, 2012 06:02
RRのmockでtapを使ったら、うまく動かなかった
require 'rspec'
require 'rr'
RSpec.configure do |config|
config.mock_with :rr
end
class Sample
def self.call
1
@ueno1969
ueno1969 / CreateRichTupple.rb
Created November 23, 2011 09:26
たっぷるたっぷるゴルフ
def a(p,n)
(1..n).map{|m|"#{p}#{m}"}*","
end
puts ["package object richTuple{",(2..21).map{|n|[" implicit def toRichTuple#{n}[#{t=a('A',n)}](t:(#{t}))= new{
def :::[B](b:B) = (b,#{t=a('t._',n)})",(2..22-n).map{|m|" def :::[#{b=a('B',m)}](p:(#{b})) = (#{a('p._', m)},#{t})"}, " }"]}.flatten, "}"]*($/*2)