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
root: "/Users/railsmonk/xfiles" | |
server_ip: "*" | |
apache2_configs_directory: "/sw/etc/apache2/alpha.d" | |
hooks_path: "#{root}/application/script/x" | |
storage_path: "#{root}/storage" | |
server_restart_marker: "/tmp/restart-server-please.flag.%d" | |
## Send emails about exceptions to | |
exception_recipients: | |
- sdmitry@gmail.com |
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
#!/bin/sh | |
rake spec |
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
#!/bin/sh | |
# Save this file as .git/hooks/pre-commit | |
rake spec |
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
"<p>blah".tidy # => "<p>blah</p>" | |
"blah".tidy # => "blah" | |
"blah<p>".tidy # => "blah" | |
"blah".tidy(:show_body_only => false) # => | |
# Renders: | |
# "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" | |
# \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> |
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
# Mocks a request to OpenID server with given response status. | |
# If you give it a hash of args as a third argument, it will act | |
# like information about user transmitted from OpenID server. | |
class ActiveSupport::TestCase | |
# Example: | |
# mock_openid_response("http://identity.url", OpenID::Consumer::SUCCESS, | |
# 'fullname' => 'Joe Black', | |
# 'email' => 'joe.black@gmail.com', | |
# 'nickname' => 'joeeeey') |
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
Deprecation raiseWarning: false. | |
Gofer new | |
squeaksource: 'MetacelloRepository'; | |
package: 'ConfigurationOfMagma'; | |
load. | |
((Smalltalk at: #ConfigurationOfMagma) project version: #stable) load: 'Tester'. |
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
# Taken here http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/247669. Reformatted. | |
# based on the C++ standard library's implementation by Ken Bloom | |
class Array | |
def next_permutation! | |
return self if length<2 | |
i = length-1 | |
while true | |
ii = i | |
i -= 1 |
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
(fact "configuration" | |
server-port => number? | |
server-url => string? | |
server-static-path => string?) | |
(fact "on-connect handler" | |
(on-connect --connection--) => anything) | |
(fact "on-disconnect handler" | |
(on-disconnect --connection--) => anything) |
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 User < ActiveRecord::Base | |
test_context(:inherit => [:account_context]) do | |
@password = "123456" | |
@user = User.create(:login => "dima", | |
:first_name => "Dima", | |
:last_name => "Pupkin", | |
:password => @password, | |
:password_confirmation => @password, | |
:account => @account) |
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
def benchmark(name, &blk) | |
t1 = Time.now | |
ret = blk.call | |
time = Time.now - t1 | |
$STATSD.timing(name, time) | |
[ret, time] | |
end | |
retvalue, time = benchmark("svn-commit-time") do | |
`svn command blah` |
OlderNewer