IMPORTANT: Backup your nginx site configs (usually under /etc/nginx/sites-available)!
Remove old nginx incl. nginx-common:
apt-get autoremove --purge nginx nginx-common| # test for Rails 4.1.9 | |
| # file: app/models/forum_markdown.rb | |
| class ForumMarkdown | |
| class DummyController | |
| def logger | |
| RAILS_DEFAULT_LOGGER | |
| end | |
| def headers |
| require 'rubygems' | |
| require 'faraday' | |
| require 'socksify' | |
| require 'socksify/http' | |
| require 'awesome_print' | |
| # This is a SOCKS monkey patch for Faraday, with example use/unit test. | |
| # Notes: | |
| # * It is altered to work with SOCKS5 authentication. | |
| # * net_http_class must return a Faraday::Adapter::NetHttp instance. |
| #ruby '2.1.0' | |
| source 'https://rubygems.org' | |
| gem 'rack', '~>1.5.2' | |
| gem 'actionpack', '~> 4.1.0.beta1' | |
| gem 'railties', '~> 4.1.0.beta1' |
| class Ticket < ActiveRecord::Base | |
| belongs_to :grouper | |
| belongs_to :user | |
| validate :user_cant_be_blacklisted, on: :confirmation | |
| validate :user_cant_double_book, on: :confirmation | |
| validate :grouper_cant_be_full, on: :confirmation | |
| validate :grouper_cant_have_occurred, on: :confirmation |
| set daemon 30 with start delay 60 | |
| set logfile syslog facility log_daemon | |
| set httpd port 2812 | |
| allow localhost | |
| set mailserver localhost | |
| set alert [email protected] but not on { instance } | |
| mail-format { | |
| From: [email protected] |
| RSpec::Matchers.define :have_json_key do |expected_key| | |
| match do |response| | |
| @body = MultiJson.load(response.body) | |
| result = @body.key?(expected_key.to_s) | |
| result &&= @body[expected_key.to_s] == @expected_val if @val_provided | |
| result | |
| end | |
| chain :with_value do |val| |
| #!/user/bin/env bash | |
| on_die() { | |
| echo | |
| echo byebye proxy | |
| echo | |
| networksetup -setsocksfirewallproxystate "Ethernet 2" off #close the proxy | |
| # the name can be "wifi" or "Ethernet 1", just see what is listed in "network preference" | |
| } |
s = Test.new(:name => "foo")
# ActiveRecord::Test after_initialize
# ActiveRecord::Test after_initialize, :on => :update
# ActiveRecord::Test after_initialize, :on => :create
# ActiveRecord::TestObserver after_initialize
# ===> #<Test id: nil, name: "foo", created_at: nil, updated_at: nil>