Tag: tips


Exercise and the Art of Christine Maintenance

July 10th, 2011 — 10:03pm

I’ve never been good at exercising regularly, despite lots of reminders, from many different sources, in various formats, explaining just how necessary exercise is for your { mental well-being, life span, quality of life, focus, self-image }. The last period of time in which I exercised regularly involved several very regimented systems (From Couch to 5KHundred Push-ups, and Groupon-spurred bikram yoga) and lasted for a total of about six weeks. This was a year ago. Before that, the last time I got regular exercise was the summer of 2006, during which I was interning in another city, and living with people who had much better habits than I.

After beginning a startup and doing very little between working and sleeping, I’ve finally (about six months in) reached a point where my schedule has stabilized a bit, and I’ve found a routine / set of incentives that I feel like I’ll be able to stick to for awhile – at least, I’ve followed it for the last seven weeks (one week longer than my last attempt) and am still going strong. I’m tired of having the phrase “disgustingly sedentary” float up in my mind when people ask me how I’ve been, and I’m looking forward to maintaining my newfound awesomeness. Below, the usual excuses I use to avoid working out, and how I’ve managed to skirt around them.

Typical Excuse #1: My schedule’s too fluid, and I can’t find time to exercise at the gym

My schedule is a bit eccentric, but once I discovered that I have a 24 Hour Fitness one block away from my office, I’ve found that I tend to come to a natural stopping point at around 1am each night. With a 24 hour gym, I can rarely find a reason to skip the gym before heading home. Plus points: I hate working out around other people, and there are rarely more than 3-4 other people at the gym between 1 and 4am (sometimes, I have the place all to myself!)

Typical Excuse #2: Cardio bores the pants off of me

My most successful stint at exercising regularly (summer of 2006) involved reading lots of Ayn Rand on a stationary bike, also late at night. I realized recently that, by bumping up the font size on my Kindle, I could easily read while running on a treadmill – and can now run for a previously unimaginably long time without noticing. (And then go for another 20-minute jog because I need to know what happens next!)

Typical Excuse #3: I know exercise is good for me, but man it’s such a time sink

When you’re running a startup, you work. A lot. And one of the things that I’ve lost (or have been unable to justify) as a result is my time to read for pleasure. By combining something that’s good for me and feels productive (cardio/gym) with something that makes me really happy and that I always want to do more of (reading for pleasure), I genuinely look forward to going to the gym and will often spend way more time exercising than I planned.

I was surprised at first with how much happier I’ve been as a result. I’m not sure if it’s actually the endorphins, or the “badass”-ness I feel from coming back to the office at 3am and sitting down for another hour or two of work (I mentioned my schedule was nutty), or finally being able to move books off my reading queue, but I’ve noticed a definite uptick in my mood and body image as a result. I’ve run something like 75 miles over the last six weeks (I make it to the gym an average of three times a week), and I’m looking forward to my numbers (I love you, Runkeeper!) going ever upward.

Comment » | personal

One-line HTTP server with Python

July 6th, 2011 — 4:39am

Most of the time, loading HTML files from the filesystem (with the file://localhost/Users/... sort of path in your URL bar) works fine – remote files are pulled in, Javascript can usually be run, and things are peachy.

Every once in awhile, though, you might run into a situation for which the file:// protocol is ill-suited — specifically, if/when you run into an error like this: Cross origin requests are only supported for HTTP.

In other words, I ran into this really cool snippet:


$ cd /home/somedir
$ python -m SimpleHTTPServer

… awhile ago, and needed it a couple of minutes ago, and could barely remember it (hat tip to LinuxJournal for being easily Googleable). So I’m posting it here for posterity, and to augment my clearly failing memory.

Running that command will make, by default, the index.html in /home/somedir accessible at http://localhost:8000.

Or you can pass in the preferred port (python -m SimpleHTTPServer 8080) into the command line instead.

Thumbs up. Onward!

* Also useful: tying this sort of thing to something like localtunnel, to brainlessly / painlessly broadcast something on your local machine to the interwebs.

Comment » | techy

How I use ifttt

May 31st, 2011 — 4:55pm

I’ve been having a ton of fun lately playing with ifttt, a service that lets you easily glue together different web services you use / rely on every day. If you remember Yahoo Pipes (wiki), ifttt is based off the same ideas – but is much easier to approach, think about, and use. There are a couple of other ifttt flow blog posts around, but my favorite blog entries are the ones that show instead of tell – so, here we go:

my ifttt tasks
ifttt tasks, as of 5/31/2011

The favorite use I found for it so far is my Game of Thrones task – I love The Atlantic‘s coverage but really couldn’t care less about their other Entertainment articles, and they don’t have category-specific RSS feeds. This way, I get things delivered straight to my inbox!

And, in the interest of keeping my inbox relevant, I have higher-frequency / immediate-action-required tasks tied to my GTalk, which makes sure that I can react quickly.

(I’ve noticed that more of my tasks are tied around consumption/notification rather than production. The other blog posts I’ve linked to above seem to tend toward duplicating/publishing content elsewhere, which is an interesting difference.)

The site is really nicely designed and is genuinely fun to use. Get on the invite list and start creating – I’m excited to see what other fun uses I find.

Note: Hah, if you look closely, my Rent reminder, the second task from the bottom has never fired. Clearly, the service is still in beta. I still use Resnooze for scheduled email reminders about things, but am looking forward to ifttt stabilizing enough for me to switch!

4 comments » | personal, techy

Heroku database -> Amazon S3 backup via rake task

May 13th, 2011 — 7:52pm

With Heroku’s basic database plan, it’s easy to run heroku pgbackups:capture every once in awhile and save a pg_dump backup of your database – but it’s not as easy as it should be to set up automatic backups of your application’s shared database. By combining Heroku’s nifty Cron Add-On (runs a Rake task via rake cron daily for free) with its existing PG Backups support, you can pretty easily get the platform to help you back up your application.

This assumes you have some amazon_s3.yml file in your config with your AWS credentials and your Heroku credentials set in your environment variables.

This currently works under Rails 3.06 and Heroku gem version 2.1.3.

While trying to get this all to work, I borrowed generously from http://librarymixer.posterous.com/40960547 (seemed to work under the Heroku gem version 1.19.1) and http://metaskills.net/2011/01/03/automating-heroku-pg-backups/, with lots of tweaking necessary to account for gem updates.

3 comments » | techy

C++ Sanity Check

April 21st, 2009 — 8:21pm

Note to self: wondering how an element got added to your std::map that you didn’t actually put there?

std::map<..>[lid] will add an empty element to your list if the lid doesn’t currently exist in the table. Awesome.

Also note to self: printing out addresses of objects is done as follows:

obj *my_obj;
printf("address: %p\n", my_obj);

not &my_obj, not printing with %u or %s. Just the above.

Note to the rest of you: I’m going to figure out some way to separate my personal blog and my techy/notes-to-self blog. Apologies for now.

Comment » | techy

Back to top