This post (like many I write) is mainly for myself.
When using CSS padding or margin, I generally will write margin-top, margin-bottom, margin-left, etc. I know there is easier syntax where I can specify all for with one line such as
margin: 0 10px 88px 10px;
The problem is, I can never remember which one is where. Know I’m not going to forget. It’s simply top, right, bottom, left… TRBL, TRouBLe, trouble. Who can forget trouble?
Sometime I want the top and bottom the same and the left and right the same. It is also a one liner:
margin: 10px 20px; /* top-bottom, right-left */
No, I’m not going to remember TBRL, that would be stupid. I’ll just remember to start at Top. See, no TRouBLe at all!
I find it quite annoying that whenever I read instructions that include adding an environment path variable you are asked to reboot your machine for changes to take effect. I know there has GOT to be a way to do it. Well, I know a way, but it’s someway kludgy.
Here is how I do it (I’m really hoping someone will comment and tell me a better way)
Continue reading “Update Windows Path Without Rebooting”
After writing my fuel trip calculator, I learned there was a bug in IE. I got it to work but I get getting ‘meters’ is null or not an object or even worse, ‘null’ is null or not an object. I tried everything I could think of in the javascript code to get rid of that message in IE.
I realized that the function was being called twice for some reason, and that is where I finally found the culprit. The error wasn’t in the javascript, it was in the html.
When I first wrote the tool, I just called the javascript function using a button and onclick method. Then I changed it to a form so you could just hit enter in any field. But, I forgot to take out the onclick method from the submit button. So therein lied the problem. Once I removed that the error went away.
So I was talking with a friend and we were figuring out the amount of money we spend on a commute to see if it is worth buying a new car for the gas savings. I was using Google Maps to determine the distance between locations. So I got the idea to create this little tool to calculate it for me. I’ve been meaning to learn the Google Maps API anyway.
DIRECTIONS: Enter the current cost of fuel, your car’s gas mileage and a start and end address to get an estimate of how much you will spend on fuel for the trip.
Distance: miles
Fuel Cost: $ per gallon
Gas Mileage: miles per gallon (mpg)
Cost Per Mile: $
One way cost: $
Round trip cost: $
Commute: If you were to make this commute 5 days a week excluding 3 weeks for vacation and holidays, you could expect to pay $ per year.