"We're building the phone powered by the Open Web!"
"If you can build a website, you can build an app"
"Great, but what if you don't have an internet connection?"
Well, um…
var searchForm = $('#search-form'), | |
searchEl = $('#search'), | |
nav = $('#tabs'), | |
fields = 'id,assigned_to,priority,summary,status,last_change_time,whiteboard', | |
fieldsPretty = { | |
'assigned_to': 'assigned to', | |
'last_change_time': 'changed' | |
}, | |
sortField = localStorage['sort-field'] || 'last_change_time', | |
sortDirection = localStorage['sort-direction'] === 'true', |
var searchForm = $('#search-form'), | |
searchEl = $('#search'), | |
nav = $('#tabs'), | |
fields = 'id,assigned_to,priority,summary,status,last_change_time,whiteboard', | |
fieldsPretty = { | |
'assigned_to': 'assigned to', | |
'last_change_time': 'changed' | |
}, | |
sortField = localStorage['sort-field'] || 'last_change_time', | |
sortDirection = localStorage['sort-direction'] === 'true', |
#!/bin/bash | |
# Which version should we fetch? | |
b2gremote="https://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-central/" | |
appname="B2G" | |
if [ "$1" == "aurora" ]; then | |
b2gremote="https://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-aurora/" | |
appname="B2GAurora" | |
fi |
if ('applicationCache' in window) { | |
function Log(el) { | |
function ts() { | |
var d = (new Date()); | |
function p(v, n) { | |
return ('00' + d['get'+v]()).substr(-n); | |
} | |
return [p('Hours',2), p('Minutes',2), | |
p('Seconds',2), p('Milliseconds',3)].join(':'); | |
} |
// # tinyAMD: a Minimal AMD shim. | |
// I define Minimal AMD as the following: | |
// * Every define() call provides a module id field (no filename magic) | |
// * No additional network traffic to fetch modules | |
// * All dependencies must be defined before a module may be required | |
// ## Uses | |
// * small-footprint production shim for use with an r.js optimized project | |
// * If you write modules in Minimal AMD coding style, you can use tinyAMD |
This is excerpted from my work on emilio.js, a d3 plotting library, but useful enough to stand on its own.
new Path()
.xScale
and yScale
.
d3.scale()
objects!xScale
and yScale
affect the x and y coordinate spaces, respectively.xScale
is supplied, y values will be in the xScale
space.<style> | |
#keyboard { | |
height: 300px; | |
} | |
.key { | |
float: left; | |
height: 320px; | |
width: 100px; | |
border: 1px solid black; | |
display: block; |
<title>picoedit</title><pre id='c' contenteditable></pre><script>var p=document.getElementById('c'),d=window.location.hash.substr(1)||'a',l=localStorage;p.innerHTML=l[d]||'> ';setInterval(function(){l[d]=p.innerHTML;},1000);</script> |
var urlparse = (function() { | |
var a = document.createElement('a'); | |
// urlparse('https://example.com:8080/bar.html?baz#yay') | |
return function(url) { | |
a.href = url; | |
return { | |
hash: a.hash, // '#yay' | |
host: a.host, // 'example.com:8080' | |
hostname: a.hostname, // 'example.com' |