will define a method stub on any instance of a class for the duration of a block.
String.stub_any_instance(:length, 42) do
assert_equal "hello".length, 42 # this assertion passes!
actually extracted the code from SimpleForm to do the job, and suggested it be included in MiniTest itself
. But that didn't fly, so I packaged it as a plugin/gem.
Why did Keynes’ promised utopia – still being eagerly awaited in the ‘60s – never materialise? The standard line today is that he didn’t figure in the massive increase in consumerism. Given the choice between less hours and more toys and pleasures, we’ve collectively chosen the latter. This presents a nice morality tale, but even a moment’s reflection shows it can’t really be true. Yes, we have witnessed the creation of an endless variety of new jobs and industries since the ‘20s, but very few have anything to do with the production and distribution of sushi, iPhones, or fancy sneakers.
from "On the Phenomenon of Bullshit Jobs" by David Graeber
Graeber discounts consumerism as the reason we work so much, with the proof being that very few of the jobs we've created have to do with producing products, the purchase of which we might consider typical examples of consumerism.
I don't purport to know the right answer here, but I also don't see how you can mention consumerism on one hand, and fail to see that if the consumerist theory is close to reality, then all of the jobs we've created would be for the purpose of obtaining those products, not for the purpose of building them.
Nevertheless, it was an interesting read, so you might check it out.
For the last 8 weeks or so, I've been out of the habit of getting up from my office chair regularly. I made a comment about it on twitter
and @jwo, thought it was important enough to take a break too
Sitting a lot is bad for your health
(even if you exercise), and as a programmer, I sit a lot. I haven't ever really felt a problem from it until recently, when I got out of the habit of taking regular breaks. In my case that was leading to back pain, mental frustration, and not getting enough water. So yesterday I started using Dejal Timeout
as a way to force myself to get up, stretch, and walk around a bit. (It fades in, dims your screen, and makes it hard to work when it's time for a break).
The results? 5000 more steps for the day (~50% increase), much more water, no back pain this morning, and yesterday I got done WAY more than I have in the past two months. I am not thinking those outstanding results will continue forever (and I realize my story doesn't suffice for proving causality), but I expect I'll remain better off than before. I set it to take a 5 minute break after every 55 minutes.
Final note: You can configure that software to not show the "skip this break" button. I recommend this. If you make it easy to skip, I think you'll end up skipping. I did keep the postpone buttons though, and used them a couple of times.
What tips do you have to help manage and maintain your health?