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: Last 10 log lines: | |
==> p: compiling object_tracing.c | |
==> p: compiling objspace.c | |
==> p: linking shared-object objspace.so | |
==> p: make[2]: Leaving directory `/tmp/ruby-build.20141225212618.1716/ruby-2.2.0/ext/objspace' | |
==> p: linking shared-object date_core.so | |
==> p: make[2]: Leaving directory `/tmp/ruby-build.20141225212618.1716/ruby-2.2.0/ext/date' | |
==> p: linking shared-object nkf.so | |
==> p: make[2]: Leaving directory `/tmp/ruby-build.20141225212618.1716/ruby-2.2.0/ext/nkf' | |
==> p: make[1]: Leaving directory `/tmp/ruby-build.20141225212618.1716/ruby-2.2.0' |
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 DeadCodeConcern | |
def self.dead_code_or_not_dead_code?(name) | |
notify_honeybadger_not_dead_code(name) | |
notify_logger_not_dead_code(name) | |
end | |
def self.notify_honeybadger_not_dead_code(name) | |
Honeybadger.notify( StandardError.new("Not dead code: #{name}") ) | |
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
evil:Inventory#change_quantity:/home/rupert/ssd/rupert/develop/paneq/inventory-mutation/lib/inventory.rb:18:a2bf6 | |
@@ -1,8 +1,8 @@ | |
def change_quantity(identifier, qty) | |
if (((qty - @reserved_quantity[identifier].sum) - @sold_quantity[identifier].sum) < 0) | |
- raise(StandardError, "quantity too low") | |
+ raise | |
end | |
@available_quantity[identifier] << (-@available_quantity[identifier].last) | |
@available_quantity[identifier] << qty | |
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
require 'benchmark' | |
ActiveRecord::Base.logger = nil | |
Benchmark.bmbm do |bench| | |
bench.report("SQL query") do | |
1000.times { Whatever.count } | |
end | |
bench.report("exception hit") do |
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 IssuesController < ApplicationController | |
default_search_scope :issues | |
before_filter :find_issue, :only => [:show, :edit, :update] | |
before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy] | |
before_filter :find_project, :only => [:new, :create, :update_form] | |
before_filter :authorize, :except => [:index] | |
before_filter :find_optional_project, :only => [:index] | |
before_filter :check_for_default_issue_status, :only => [:new, :create] | |
before_filter :build_new_issue_from_params, :only => [:new, :create, :update_form] |
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
"777żółć".byteslice(0,6).scrub("") | |
"777żółć".byteslice(0,7).scrub("") | |
"777żółć".byteslice(0,8).scrub("") | |
"777żółć".byteslice(0,9).scrub("") |
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
g = Gibbon::API.new(MAILCHIMP_API_KEY) | |
#=> #<Gibbon::API:0x00000007ad89d0 @api_key="KEY", @api_endpoint=nil, @timeout=nil, @throws_exceptions=nil, @default_params={:apikey=>"KEY"}> | |
g.templates | |
#=> #<Gibbon::APICategory:0x00000007100cc8 @category_name="templates", @api_key="KEY", @api_endpoint=nil, @default_params={:apikey=>"KEY"}, @throws_exceptions=true, @timeout=30> | |
g.respond_to?(:templates) | |
#=> false | |
g.methods.include?(:templates) |
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
[color] | |
ui = always | |
[color "diff"] | |
old = blue | |
[color "branch"] | |
remote = blue | |
plain = white | |
[color "status"] | |
added = yellow | |
updated = green |
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 'benchmark' | |
s1 = Struct.new(:login, :password).new("login", "password") | |
class S | |
attr_accessor :login, :password | |
def initialize(login, password) | |
@login = login | |
@password = password | |
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
if (-f $document_root/system/maintenance.html) { | |
return 503; | |
} | |
error_page 503 @maintenance; | |
location @maintenance { | |
internal; | |
if ($http_accept ~ json) { | |
return 503 "{}"; | |
} |