Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-08-2014, 04:08 AM   #1
Emil
Confirmed User
 
Emil's Avatar
 
Join Date: Feb 2007
Location: Sweden
Posts: 5,650
Convert LBS to Kilo, gallons to liters, miles to km... (and the other way around)

Create a new bookmark with this javascript in the URL, when you click the bookmark it will convert the stuff on the page.

Code:
javascript:(function(){regex=/(\.?\d+(?:\.\d*)?)\s*?(lb|pound|#|kg|stone|gallon|gal|liter|litre|l|oz|fl oz|cup|mile|km|meter|m|cm)s?(?!\w)/ig;lbs_kg_factor=2.20462262;stone_kg_factor=6.35029318;l_gal_factor=3.78541178;floz_l_factor=0.0295735296;cup_l_factor=0.236588236;mile_km_factor=1.609344;function format(a,b){return a+' <em style="color:#999;">('+b+')</em>'}function convert(a,b,c,d){if(d==null)d=10;a=a/b;return Math.round(d*a)/d+" "+c}function convert_cm_to_feet_and_inches(a){feet=Math.floor(a/30.48);inches=Math.floor(a%(30.48/2.54));return feet+"′"+inches+'″'}function replace(a,b,d,e,s){b=parseFloat(b);d=d.toLowerCase();var c=0;switch(d){case'lb':case'pound':case'#':c=convert(b,lbs_kg_factor,'kg');break;case'kg':c=convert(b,1/lbs_kg_factor,'lbs',2.0);break;case'stone':c=convert(b,1/stone_kg_factor,'kg');break;case'gallon':case'gal':c=convert(b,1/l_gal_factor,'l');break;case'liter':case'litre':case'l':c=convert(b,l_gal_factor,'gal');break;case'oz':case'fl oz':c=convert(b,1/floz_l_factor,'l');break;case'cup':c=convert(b,1/cup_l_factor,'l');break;case'mile':c=convert(b,1/mile_km_factor,'km');break;case'km':c=convert(b,mile_km_factor,'miles');break;case'meter':case'm':c=convert_cm_to_feet_and_inches(b*100);break;case'cm':c=convert_cm_to_feet_and_inches(b);break}return format(a,c)}document.body.innerHTML=document.body.innerHTML.replace(regex,replace)})();
Try it out:
150 kg
4.3 miles
900 lbs
5.4 stone
7 litre
2 gallon
__________________
Free 🅑🅘🅣🅒🅞🅘🅝🅢 Every Hour (Yes, really. Free ₿itCoins.)
(Signup with ONLY your Email and Password. You can also refer people and get even more.)
Emil is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-08-2014, 05:14 AM   #2
nexcom28
So Fucking Banned
 
Join Date: Jan 2005
Posts: 3,716
That is perhaps the coolest thing ever!
nexcom28 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-08-2014, 05:16 AM   #3
nexcom28
So Fucking Banned
 
Join Date: Jan 2005
Posts: 3,716
Edit: It fucks up gfy.

If you use it and then try and leave a quick comment you get a javascript popup (different to the gfy popup) informing you that the message is too short.

Still cool though.
nexcom28 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.