Skip to content

Instantly share code, notes, and snippets.

@grobie
grobie / production.rb
Created February 25, 2014 16:52
config/environments/production.rb
$stdout.sync = true
config.logger = Logger.new($stdout).tap do |logger|
logger.level = ENV['DEBUG'] ? Logger::DEBUG : Logger::INFO
end

You already have a proved you are grobie at github; overwrite? [y/N] Please �[1mpublicly�[22m post the following Gist, and name it �[1m�[31mkeybase.md�[39m�[22m:

Keybase proof

I hereby claim:

  • I am grobie on github.
  • I am grobie (https://keybase.io/grobie) on keybase.
  • I have a public key whose fingerprint is DEA7 8E64 C8A5 9767 D9B5 BC17 32C1 A2E1 8527 BC46
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQINBFHxVdwBEADWHq7XLAyWZoKX+y92xBECxgzzFSJ6M6KlrT4iMvTxvqtlbs6/
eMROvWvmQqnXnVZaR/TX0/nABcbkKXTxeJO1ErlXhGbIdq2teOrzTOntAqhlwRiw
4jtY5EZxZD/42BoWFaoQYRyjEqs1gK1xHHbbljoQFbaT+2dQxhblTmkXdSXMHDUQ
AydWBrXjwndkEQJkhifDTDa5W4lVxu7HN+wsR5BKh8SmN+SKblkrDjL+Tbfpfomk
RTCDqg7VU+PUIbCJhgDIKBgFDfPeNDPCFwesuy7FNULBVJKOLoBeyhbiVAFQqHAd
14nhi3eTRlQKNb/XVcrY6nRk9Un9BrtriJrXaOe8r5usuN7ojLFSM70/7PQpFMdX
4ee2pK3vaBia8ojP3cMRRqiED/ohi973lBQHICUP3///6br+kPRa0aoJJU+ONvnP
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQINBFHRs6cBEADlTJqKvIsnfwm0GTyuVwrl5fAcrZXMBjlvN9JvGn2R+Pjn5rkt
Og/PiYpIB0EQaB2DRD87Tt4Wh9Zhdrm6851K1LnBVHTRZr2B0Ta/qUaqxauZHL1Q
oWF9XJ5d38GqkKCZM6imzIliXO2x75lAMpLdYetRABSCltT1f2rsFyJlZjKUtgwJ
rFBFL2umzK1OsCapA87LA2zE75Zo0sl04lQFDN1IK+6tzfTvxr6xigLrJ0sGUBz0
VVl1r8YwsejMFr83zdWpYOuj9XjpsyfACrtYHZk6GzdrgKxCf+GuxIt+mZK/c/Hw
3DAj/a8I27Bwhdp33fJvva/oNeV++LNydnOpj3osohJp5/e/jaXb1K73MI/R15b1
Wz2ZY8LGFs3xLHBIecV7n2oR+c8pxEEqc179YvxsUHNH9dUYCanVnlxmChzYd0aQ
@grobie
grobie / golink.zsh
Last active August 29, 2015 14:10
golink
@grobie
grobie / instrumentation.go
Created January 2, 2015 17:34
consul metrics exporter
// consulCollector implements the prometheus.Collector interface.
type consulCollector struct {
bin string
errc chan error
metrics map[string]prometheus.Gauge
}
func newConsulCollector(bin string, errc chan error) prometheus.Collector {
return &consulCollector{
bin: bin,
@grobie
grobie / consul.log
Created July 15, 2015 23:14
consul vote issues
2015-07-15_23:10:51.63143 2015/07/15 23:10:51 [WARN] raft: Heartbeat timeout reached, starting election
2015-07-15_23:10:51.63146 2015/07/15 23:10:51 [INFO] raft: Node at 10.1.2.3:5365 [Candidate] entering Candidate state
2015-07-15_23:10:51.63294 2015/07/15 23:10:51 [ERR] raft: Failed to make RequestVote RPC to 10.5.6.7:5365: dial tcp 10.5.6.7:5365: connection refused
2015-07-15_23:10:51.63665 2015/07/15 23:10:51 [INFO] raft: Node at 10.1.2.3:5365 [Follower] entering Follower state
2015-07-15_23:10:53.15118 2015/07/15 23:10:53 [WARN] raft: Heartbeat timeout reached, starting election
2015-07-15_23:10:53.15120 2015/07/15 23:10:53 [INFO] raft: Node at 10.1.2.3:5365 [Candidate] entering Candidate state
2015-07-15_23:10:53.15249 2015/07/15 23:10:53 [ERR] raft: Failed to make RequestVote RPC to 10.5.6.7:5365: dial tcp 10.5.6.7:5365: connection refused
2015-07-15_23:10:54.87441 2015/07/15 23:10:54 [WARN] raft: Election timeout reached, restarting election
2015-07-15_23:10:54.87443
module ActiveSupport
module Dependencies
def load_missing_constant_with_shared_code(from_mod, const_name)
puts "Looking for #{const_name}"
load_missing_constant_without_shared_code(from_mod, const_name)
end
alias_method_chain :load_missing_constant, :shared_code
end
class Customer
def self.options_for_select
all.collect do |customer|
[customer.formatted_for_option, customer.id]
end
end
def formatted_for_option
"#{id}: #{title}"
end
class Doc < File
has_attachment :content_type => 'application/msword',
:max_size => 2.megabytes,
:storage => :file_system
end