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
gems: | |
- ivy4r | |
ivy: | |
settings.file: ivysettings.xml |
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
define 'foo' do | |
Java.java.lang.System.setProperty("foo", "bar") | |
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
# server running with `rackup -s mongrel multiple.ru` | |
$ curl -v http://127.0.0.1:9292/ | |
* About to connect() to 127.0.0.1 port 9292 (#0) | |
* Trying 127.0.0.1... connected | |
* Connected to 127.0.0.1 (127.0.0.1) port 9292 (#0) | |
> GET / HTTP/1.1 | |
> User-Agent: curl/7.20.0 (i386-apple-darwin10.3.0) libcurl/7.20.0 OpenSSL/0.9.8n zlib/1.2.5 libidn/1.18 | |
> Host: 127.0.0.1:9292 | |
> Accept: */* |
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
run proc { |env| | |
[ | |
200, | |
{ "Content-Type" => "text/plain", "X-Foo" => "Bar\nBaz" }, | |
["Foo?\n"] | |
] | |
} |
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
Gemfile.lock | |
*.sqlite3 |
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
gemspec |
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 'sinatra' | |
get '/' do | |
<<-HTML | |
<ul> | |
<li><a href="/301.html">301</a></li> | |
<li><a href="/302.html">302</a></li> | |
<li><a href="/303.html">303</a></li> | |
</ul> | |
HTML |
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
# Will prompt the first time | |
`security find-internet-password -gs smtp.gmail.com 2>&1 | grep password`. | |
split(' ').last.gsub('"', '').strip |
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
# I'm not sure why but sometimes Syck is used for 'yaml' even under 1.9.2. This forces the issue. | |
Y = | |
if RUBY_VERSION =~ /1.9/ | |
require 'psych' | |
Psych | |
else | |
require 'yaml' | |
YAML | |
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
# encoding: UTF-8 | |
def test(env) | |
fn = 'foo' | |
File.open(fn, 'w:UTF-8') { |f| f.write '☃' } | |
begin | |
puts "Read from #{env} file: #{File.read(fn, :encoding => 'UTF-8')}" | |
rescue => e |