Skip to content

Instantly share code, notes, and snippets.

@yoavweiss
yoavweiss / multiple_forms.html
Created March 19, 2013 17:31
An HTML page with multiple forms
<html>
<body>
<form method="post" action="basket_backend">
Where do I send this to? <input type="text">
<input type="submit" value="You will SUBMIT!!!">
</form>
<form method="post" action="product_backend">
Shoe
<input type="button" value="+">
<span class="quantity">1</span>
@yoavweiss
yoavweiss / GeckoNetworkManager.java
Created December 4, 2012 16:56
Firefox on Android BW detection
static private final double kDefaultBandwidth = -1.0;
static private final boolean kDefaultCanBeMetered = false;
static private final double kMaxBandwidth = 20.0;
static private final double kNetworkSpeedEthernet = 20.0; // 20 Mb/s
static private final double kNetworkSpeedWifi = 20.0; // 20 Mb/s
static private final double kNetworkSpeedWiMax = 40.0; // 40 Mb/s
static private final double kNetworkSpeed_2_G = 15.0 / 1024.0; // 15 kb/s
static private final double kNetworkSpeed_2_5_G = 60.0 / 1024.0; // 60 kb/s
@yoavweiss
yoavweiss / gist:3609089
Created September 3, 2012 12:43
post-onload async script loader
(function(s){var a=addEventListener,d=document;if(a){a("load",function(){setTimeout(function(){d.body.appendChild(d.createElement('script')).src=s})})}})("a.js")