Categories
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 biketoworkcalculator.com

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: https://github.com/ohryan/biketoworkcalculator

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

Categories
Web Development

The Problem with NPM

Whenever you run `npm install` it generates a local, project specific /node_modules/ directory with literally 10s of thousands of files and folders.

Why?! WHY?!

I understand that javascript is a simple scripting language, missing many features that are baked in to more traditional languages like PHP and friends.

I understand that many node modules are a work in progress, that are updated frequently.

I don’t understand the benefit off having these packages sitting inside each project directory.

I understand that disk space is cheap and it doesn’t really matter.

Categories
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.

Categories
Tips & How To's Websites

WhyFireFoxIsBlocked is wrong! Adblock Plus is 100% Detectable!

whyfirefoxisblocked.com does not know what they’re talking about. Ad Block Plus is 100% lame and 100% detectable.

The following code detects ad block plus:

index.html:
<script language="javascript"> var disabled = false; </script>
<script src="something.js?thisistotrickyou=http://a.as-us.falkag.net/...
dat/njf/41/domain.com/ros_pop_tag.js"></script>
<script language="javascript">
if(!disabled){
// 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."); }
</script>

something.js:
disabled = true;

Proof of concept