http://ln.hixie.ch/?start=1037910467&count=1
http://ln.hixie.ch/?start=1137740632&count=1
/** | |
* Return a timestamp with the format "m/d/yy h:MM:ss TT" | |
* @type {Date} | |
*/ | |
function timeStamp() { | |
// Create a date object with the current time | |
var now = new Date(); | |
// Create an array with the current month, day and time |
/* 1. write it out for older browsers */ | |
/* 2. use the vendor prefix for webkit */ | |
/* 3. use the vendor prefix for moz */ | |
/* 4. include the un-prefixed version last */ | |
#foo { | |
width: 200px; | |
width: -webkit-calc(50% - 100px); | |
width: -moz-calc(50% - 100px); | |
width: calc(50% - 100px); |
/* | |
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/ | |
* Better handling of scripts without supplied ids. | |
* | |
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function. | |
*/ | |
(function(doc, script) { | |
var js, | |
fjs = doc.getElementsByTagName(script)[0], |
/* | |
Ex: | |
ftn.extend({ | |
foo: function() { | |
console.log( "foo" ); | |
} | |
}); | |
ftn.foo(); |
module.exports = (function(){ | |
const MS = | |
{ seconds: 1000 | |
, minutes: 60 * 1000 | |
, hours: 60 * 60 * 1000 | |
, days: 24 * 60 * 60 * 1000 | |
, weeks: 7 * 24 * 60 * 60 * 1000 | |
, months: 30 * 7 * 24 * 60 * 60 * 1000 | |
, years: 365 * 24 * 60 * 60 * 1000 } |
<!-- include jQuery --> | |
<script> | |
$('form').find('input:text').val( function(i, val) { | |
return $(this).attr('name'); | |
}); | |
$('form').find('select').each( function(a) { | |
$(this).find('option').each( function(b) { | |
if ( $(this).val() !== '' ) { | |
$(this).parent().val( $(this).val() ); |
<a href="javascript:(function(){if(localStorage.length){for(var i=0;i<localStorage.length;i++){console.log(localStorage.key(i)+':'+localStorage.getItem(localStorage.key(i)));}}})();">Check localStorage</a> |
if ( localStorage.length ) { | |
for ( var i=0; i < localStorage.length; i++ ) { | |
console.log( localStorage.key(i) + ":" + localStorage.getItem( localStorage.key(i) ) ); | |
} | |
} |
<a href="javascript:(function(){localStorage.clear();})();">Clear localStorage</a> |