Skip to content

Instantly share code, notes, and snippets.

View cmelbye's full-sized avatar

Charlie Melbye cmelbye

  • Snap, Inc.
  • Santa Monica
View GitHub Profile
[1] pry(main)> cd ActionDispatch::Request
[2] pry(ActionDispatch::Request):1> show-method headers
From: /Users/charliemelbye/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.16/lib/action_dispatch/http/request.rb @ line 126:
Owner: ActionDispatch::Request
Visibility: public
Number of lines: 3
def headers
Http::Headers.new(@env)
[1] pry(main)> cd ActionDispatch::Request
[2] pry(ActionDispatch::Request):1> ls Http::Headers
NameError: uninitialized constant HTTP::Headers
from (eval):1:in `__binding__'
[2] pry(ActionDispatch::Request):1> show-source Http::Headers#[]
Error: Couldn't locate a definition for Http::Headers#[]!
package main
import (
"bytes"
"net/http"
"appengine"
"appengine/urlfetch"
)
class SomeJob
def self.perform(some_arg)
# do stuff
rescue Resque::TermException => e
puts "SIGTERM, retrying..."
Resque.enqueue SomeJob, some_arg
end
end
npm ERR! peerinvalid The package karma does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer grunt-karma@0.6.2 wants karma@~0.10.0
npm ERR! peerinvalid Peer karma-growl-reporter@0.1.1 wants karma@>=0.9
npm ERR! peerinvalid Peer karma-junit-reporter@0.2.2 wants karma@>=0.9
npm ERR! peerinvalid Peer karma-mocha@0.1.6 wants karma@>=0.12.8
npm ERR! peerinvalid Peer karma-requirejs@0.2.2 wants karma@>=0.9
npm ERR! peerinvalid Peer karma-chai-sinon@0.1.3 wants karma@~0.6 || ~0.8 || ~0.10 || ~0.12
npm ERR! peerinvalid Peer karma-coverage@0.2.6 wants karma@>=0.9
npm ERR! peerinvalid Peer karma-coffee-preprocessor@0.1.3 wants karma@>=0.9
npm ERR! peerinvalid Peer karma-phantomjs-launcher@0.1.4 wants karma@>=0.9
type bodyReader struct {
body []byte
}
func (r bodyReader) Bytes() []byte {
return r.body
}
func (r bodyReader) Read(b []byte) (int, error) {
return 0, errors.New("storage: bodyReader.Read() is not implemented and should not be used")
--- contention:
cycles/second=2600060886
#cloud-config
coreos:
etcd:
# generate a new token for each unique cluster from https://discovery.etcd.io/new
discovery: https://discovery.etcd.io/foobar
# multi-region and multi-cloud deployments need to use $public_ipv4
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
➜ ~ go tool pprof http://foohost.com/debug/pprof/heap |& tail -n 1
FATAL ERROR: Did not specify profile file
➜ ~ curl http://foohost.com/debug/pprof/heap | head -n 5
heap profile: 1847: 37467632 [33000: 3345448904] @ heap/1048576
249: 8159232 [249: 8159232] @ 0x425dd5 0x4258b8 0x427001 0x42708a 0x42a61d 0x42a553 0x531fbb 0x5320d2 0x532d62 0x535e9a 0x4ce822 0x4d77ea 0x56e1d3 0x56e3e1 0x4cc4f5 0x4152b0
213: 6979584 [213: 6979584] @ 0x425dd5 0x4258b8 0x427001 0x42708a 0x42a61d 0x42a553 0x531fbb 0x5320d2 0x532d62 0x535e9a 0x4ce822 0x4d77ea 0x56e5eb 0x4abd82 0x4c7321 0x4c723a 0x4ce1a4 0x4f3903 0x4661e7 0x4668ba 0x4152b0
176: 5767168 [176: 5767168] @ 0x425dd5 0x4258b8 0x427001 0x42708a 0x42a61d 0x42a553 0x531fbb 0x5320d2 0x532d62 0x535e9a 0x4ce822 0x4d77ea 0x56e5eb 0x4f3b70 0x4c7321 0x4c723a 0x4ce1a4 0x4f3903 0x4661e7 0x4668ba 0x4152b0
4: 1212416 [505: 153067520] @ 0x425dd5 0x4258b8 0x427001 0x42708a 0x42a61d 0x42a553 0x4f7b34 0x4f7414 0x4f75e6 0x5660c8 0x4f398b 0x4661e7 0x4668ba 0x4152b0
Stacktrace (most recent call first):
/app/app/views/layouts/email.html.erb:326:in `_app_views_layouts_email_html_erb___746059003612520776_69979826039300'
<img src="<%= image_url("everalbum.png") %>" class="logo" />
action_view/template.rb:145:in `block in render'
view.send(method_name, locals, buffer, &block)
active_support/notifications.rb:125:in `instrument'
yield payload if block_given?
action_view/template.rb:143:in `render'
ActiveSupport::Notifications.instrument("!render_template.action_view", :virtual_path => @virtual_path) do