Solutions to problems or quirks I shouldn't have.
Stack overflow in React (`Maximum call stack size exceeded`)
Triggered this one a week ago with something like the following (pseudocode):class MyComponent extends React.Component {
static propTypes = {
thing: PropTypes.shape({
foo: PropTypes.string,
bar: PropTypes.string,
}).isRequired,
onThingChange: PropTypes.func.isRequired,
}
componentWillReceiveProps({ thing }) {
if (thing.foo !== this.props.thing.foo) {
// perhaps validate foo, or maybe convert it to some "canonical" form
const newFoo = validateAndMakeCanonical(thing.foo)
this.handleFooChange(newFoo)
}
}
handleFooChange(newFoo) {
this.props.onThingChange({
...this.props.thing,
foo: newFoo
})
}
render() {
return (
<button onClick={() => this.handleFooChange('bar')}>
Click me
</button>
}
}
Spot the issue.
_(click for spoiler)_
`handleFooChange` works fine for the button click, but when it's called from `componentWillReceiveProps` it will pass the old value of `bar`. This will trigger another update, which will call `componentWillReceiveProps` to get called again... eventually this overflows the stack.Cannot assume role using AWS STS
Even if you are running on a user or role with full admin privileges, you still need to add a trust relationship from the role you're trying to assume to the user/role you're currently using.rvm gives a `Regenerating ruby-2.0.0-p451 wrappers.........` message at every terminal open
Run `rvm get head` to update.Need to install Docker on a new Linux box
`curl -L https://get.docker.com | sudo sh`Connecting CUPS to my HP LaserJet
See [instructions](http://askubuntu.com/questions/575547/how-can-i-install-hp-laserjet-p1102w-on-ubuntu).sudo -i
apt-get update
apt-get install --reinstall hplip
hp-setup -i
Not sure yet if this is the fix, but there is a driver you can download here.