in code, philosophy, tech

Some code and some thoughts…


GMail has become a part of our lives and needs protection

I started yesterday on the year long trek to Being Awesome and I must admit, I’m scared. I can’t think of blog posts beyond a few days and I guess pretty soon, I’ll be writing about things that happen in my life on a day to day basis. Until then, I’m moving, so I’m happy.

I wrote some code yesterday. Not too much, just a little. There’s a glaring missing functionality in GMail – automatic logout. This is important if you’re a forgetful person on a public computer. GMail holds our entire lives for most of us and that means that we need to protect it as much as possible. So, inspired, I got to work.

I know that the only good way to add functionality to GMail is through their Gadgets API. (This, despite the fact that I tried making one long ago and failed.) Gadgets are small pieces of code that run within GMail and will always load in the browser, no matter where you open GMail. That way, you’ve got security where ever you go, not just at home or on your personal computer.

You’ve heard the why, so for code geeks, here’s the how…

I studied the Google GMail Gadgets API here and used some Javascript, mostly from W3Schools. It’s a great resource for practically all important website building code. It’s got great examples and their “Try It” option is awesome. I started building using an example from the Google dev site. The basics are that this is an XML file with Javascript code embedded in it. I used XML based variables that are called User Preferences to save the password and the time lapse before which GMail tries to log itself out. After that it was a simple case of the javascript function setInterval() to run the code over and over again to check if the time has run out or not.

I’m not posting the code right now, though when I do, I’ll be explaining it fully. I’m delaying because I want the ideas of my best critic, my brother. He’s my Alpha tester, should he choose to accept the mission. 🙂

Moving on,  I’ve been reading the Wiki on Marcus Aurelius, a Roman Emperor who ruled from 161 AD to 180 AD. It’s amazing how one can be a warrior and a philosopher at the same time. What little I’ve read about him tells me that it was during expansionist or defensive wars that he wrote most of his philosophy. Tells us mortals that we should think poignantly about each passing day. No point just going about our lives just working without thinking. There’s a lot of thought that can be brought to our minds if we want to. I’ll probably post more about Aurelius if I find the topic interesting or if I manage to read through some of his writings.

Until then, I’m spending time doing some more stuff, hopefully so that I’ve achieved something before my break comes to an end…

Image Courtesy. SSDP.Org

What do you think?


This site uses Akismet to reduce spam. Learn how your comment data is processed.