Jun 19 2008

Remember TRBL

Tag: YadaDustin @ 10:34 am

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!


Jun 19 2008

Update Windows Path Without Rebooting

Tag: Programming & InternetDustin @ 4:38 am

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”


Jun 06 2008

‘null’ is null or not an object

Tag: Programming & InternetDustin @ 9:14 am

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.


Jun 04 2008

Trip Fuel Cost Calculator

Tag: Programming & InternetDustin @ 4:03 pm

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.

Fuel Cost:
dollars per gallon

Your car’s average gas mileage:
miles per gallon (mpg)

to




ss_blog_claim=4973c51f5e7bec57951f995fed1b85f3 ss_blog_claim=4973c51f5e7bec57951f995fed1b85f3