I have a two monitor setup, but I like my laptop screen turned off (via Display
).
When disconnecting the VGA cable, the screen is blank. I put the following command into ~/scripts/turn_on_laptop_screen.sh
.
xrandr --output eDP-1 --mode 1366x768
module Rspec | |
module Helpers | |
def factory(name, method_name, &block) | |
let(name) { block.call } | |
end | |
end | |
end | |
RSpec.configure do |c| | |
c.extend Trailblazer::Rspec::Helpers |
var NewInput = React.createClass() { | |
getInitialState: function() { | |
return { | |
value: 'Hello!', | |
othervalue: this.props.othervalue | |
}; | |
}, | |
handleChange: function(event) { | |
this.setState({value: event.target.value}); |
{"_embedded"=> | |
{"things"=> | |
[{"name"=>"TRB", | |
"id"=>3, | |
"_embedded"=> | |
{"authors"=> | |
[{"email"=>"[email protected]", | |
"id"=>3, | |
"_links"=>{"self"=>{"href"=>"/api/users/3"}}}]}, | |
"_links"=>{"self"=>{"href"=>"/api/things/3"}}}, |
There's a :fatal
option when writing to rack.errors
. However, that doesn't happen so far.
This will write exceptions to STDOUT
Rails.logger = Logger.new(STDOUT)
# Gemfile: | |
gem "minitest-line" | |
# ~/.bash_login | |
alias t="bundle exec ruby -Itest " | |
# running tests: | |
# $ t test/crud_test.rb -l 122 |
contract_class = ... | |
representer_class = Disposable::Twin::Schema.from(contract_class, | |
include: [Roar::JSON], | |
superclass: Representable::Decorator, | |
representer_from: lambda { |inline| inline.representer_class }, | |
options_from: :deserializer | |
) |
problem is that in capture, we need access to the output buffer, and that only works via an instance variable, as when we call capture in the view, it goes back to the cell, but doesn't "pass" us the current output buffer or the current template. |
gem "ruby-prof" | |
require "ruby-prof" | |
Song = Struct.new(:a, :b, :c, :d, :e, :f, :g, :h, :i, :j, :k, :l, :m, :n, :o) # FIXME: what if we don't have STruct#options | |
song = Song.new(1,2,3,4,5,6,7,8,9,10) | |
class CopyTwin |
alias be="bundle exec" | |
alias t="bundle exec ruby -Itest" |