Culture Websites

Cycling, Javascript and Saving the Planet

A few weeks ago I bought a basic road bike with the intention of cycling to work. And I’m totally hooked! Addicted maybe? I think I finally get it.

My primary reason for biking to work is to level up the amount of exercise I get in every week, but I’m aware that leaving the car at home has some obvious side effects. By burning less gasoline I’m obviously saving some money and I’m keeping some amount of carbon out of the air.

Meanwhile, I’ve been looking for a good practical way to level up my vue.js skills. So I challenged myself to build a simple tool in vue.js to help me quantify just how much CO2 I’m leaving in the tank and how much money I’m leaving in my wallet.

The result

It’s a dead simple tool that allows you to roughly calculate CO2 and dollars you save by riding a bike. Check it out for yourself.

I was actually quite surprised that biking only one day per week would save me around $10 in gasoline over the course of a month.

If you’d like to look at the code or correct my math or whatever, it’s up on github:

Oh and if you’re in to cycling, follow me on Strava.

Tips & How To's

How To: File Upload Progress Bar. No Flash. No PHP addons.

Upload progressbars are pretty common on the web these days, they add a touch of feedback to the long and mysterious process of uploading a file to a website. Unfortunately, the most common methods for doing so involve flash or baring that PHP addons that require a recompiling.

In this post I’m going to talk about creating an upload progress bar without the need for a clunky flash object. I’m going to do it with PHP, jQueryUI and a gracefully-degrading framework-independent¬†library.

Tips & How To's Websites

WhyFireFoxIsBlocked is wrong! Adblock Plus is 100% Detectable! does not know what they’re talking about. Ad Block Plus is 100% lame and 100% detectable.

The following code detects ad block plus:

<script language="javascript"> var disabled = false; </script>
<script src="something.js?thisistotrickyou=
<script language="javascript">
// DO SOMETHING HERE, like a redirect
alert("You Are Using Ad Block Plus or some other blocking software! Please don\'t, our site operates on ad revenue."); }

disabled = true;

Proof of concept