May 2015
Tuesday, May 26, 2015
Will this make me feel better tomorrow?
I came home for lunch today and I feel like crap. I feel stressed and tired most of the time. #
I shouldn’t though. Since the end of December I’ve been doing yoga 2-3 times a week. Even though I have an 8-month old daughter I actually sleep pretty well. My job does stress me out pretty regularly, but it’s way better than it was back in August. I have two great developers on my team now that I’m able to have work on things so I don’t have to. #
However I don’t eat particularly well. My wife and I are trying to improve, but it’s difficult. I don’t typically plan my meals in advance which puts me in situations where I’m hungry and I need to find something to eat. That usually means I end up going out to eat or eating something quick at home that may not be ideal for being healthy. #
So today I had an idea. Before I eat something, I need to ask myself a simple question. #
Will this make me feel better tomorrow? #
This doesn’t have to only apply to food. Just something in general I should be more aware of. I think too much of my daily habits are less than ideal, and happen because I’m trying to solve a short term problem. How do I make myself feel better now? What can I eat now? #
Yes, I do need to start planning my food out more, but hopefully this minor change will help me make better decisions in the short term. #
Andrew ShellSaturday, May 23, 2015
Facebook Comments
Dave Winer uses Facebook comments on his Liveblog and today I wanted to comment on his post about liveblogging. However before I did this I had to check something out. #
I went on Facebook and found where he had posted a link to his post and was surprised to find one comment on Facebook and zero comments on his post. #
Why doesn’t Facebook keep these in sync? I would think it would be way better for Facebook and for bloggers if comments on one page showed up on the other. Why split the conversation? #
Andrew ShellFriday, May 1, 2015
Laravel UTC Model
I’ve been playing around with Laravel lately and overall I like it. #
One issue I ran into pretty quickly was that I would like to store datetime fields in the database as UTC and then store the timezone (in this case for an event) in another field. #
Laravel seems to have a global timezone configured and any DateTime pulled out of the database is assumed to be this timezone. If you assign a field with a different timezone it doesn’t seem to convert to this global timezone when saving so you can end up with weird inconsistant timezones all over the place. #
So I put together a little class that extends IlluminateDatabaseEloquentModel
and converts between timezones on the fly. #
It also allows me to specify the timezone I want to use (defaults to app.timezone) for that particular model. #
If you’re a Laravel developer I’d love to get some feedback as I’m new to Laravel and I may just be missing something. #
Here’s the code: UtcModel.php #
Andrew Shell