I hereby claim:
- I am vadim-v on github.
- I am vadimv (https://keybase.io/vadimv) on keybase.
- I have a public key ASDBCAN0FOr7U_aGH1p-d78aD6esxngbndAEL6BJcUlAqwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| <form action="<%= @pay_desc['mrh_url'] %>" method="post"> | |
| <input type=hidden name=MrchLogin value="<%= @pay_desc['mrh_login'] %>"> | |
| <input type=hidden name=OutSum value="<%= @pay_desc['out_summ'] %>"> | |
| <input type=hidden name=InvId value="<%= @pay_desc['inv_id'] %>"> | |
| <input type=hidden name=Desc value="<%= @pay_desc['inv_desc'] %>"> | |
| <input type=hidden name=SignatureValue value="<%= @pay_desc['crc'] %>"> | |
| <input type=hidden name=Shp_item value="<%= @pay_desc['shp_item'] %>"> | |
| <input type=hidden name=IncCurrLabel value="<%= @pay_desc['in_curr'] %>"> | |
| <input type=hidden name=Culture value="<%= @pay_desc['culture'] %>"> | |
| <input type=submit value='Оплатить'> |
| # If you're getting this error trying to use ApacheBench on OS X Lion: | |
| # Benchmarking mwmanning.com (be patient)...apr_socket_recv: Connection reset by peer (54) | |
| # | |
| # You need to download the latest beta version of Apache and rebuild ab. | |
| # Here's how (assuming you have homebrew installed). | |
| # Install Homebrew (https://github.com/mxcl/homebrew) and then the Perl Regex support | |
| brew install pcre | |
| # Download the latest from http://httpd.apache.org/download.cgi, then decompress and compile it |
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.
| # Setup | |
| # ===== | |
| # | |
| # Put this gist in Rails.root/config/initializers/cancan.rb | |
| # Add Squeel to Gemfile, see https://github.com/ernie/squeel | |
| # | |
| # gem "squeel", "~> 0.9.3" | |
| # | |
| # Load Squeel hash and symbol extensions in squeel config initializer | |
| # |
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
| def generate_secure_s3_url(s3_key) | |
| # | |
| # s3_key would be a path (including filename) to the file like: "folder/subfolder/filename.jpg" | |
| # but it should NOT contain the bucket name or a leading forward-slash | |
| # | |
| # this was built using these instructions: | |
| # http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?S3_QSAuth.html | |
| # http://aws.amazon.com/code/199?_encoding=UTF8&jiveRedirect=1 | |
| s3_base_url = MyApp::Application::S3_BASE_URL # i.e. https://mybucket.s3.amazonaws.com |
I'm a fan of MiniTest::Spec. It strikes a nice balance between the simplicity of TestUnit and the readable syntax of RSpec. When I first switched from RSpec to MiniTest::Spec, one thing I was worried I would miss was the ability to add matchers. (A note in terminology: "matchers" in MiniTest::Spec refer to something completely different than "matchers" in RSpec. I won't get into it, but from now on, let's use the proper term: "expectations").
Let's take a look in the code (I'm specifically referring to the gem, not the standard library that's built into Ruby 1.9):
# minitest/spec.rb
module MiniTest::ExpectationsThis gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| source :rubygems | |
| # We are not loading Active Record, nor Active Resources etc. | |
| # We can do this in any app by simply replacing the rails gem | |
| # by the parts we want to use. | |
| gem "actionpack", "~> 3.2" | |
| gem "railties", "~> 3.2" | |
| gem "tzinfo" | |
| # Let's use thin |