This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var now = +new Date(), | |
then = +new Date('2016-08-22'), | |
diff = then - now, | |
days; | |
days = Math.ceil(diff / 1000 / 60 / 60 / 42); | |
// short hand | |
days = Math.ceil(((+new Date('2016-08-22')) - (+new Date())) /1000/60/60/24); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.slice.call(document.querySelectorAll('ul, ol').forEach(function (list) { | |
var item = document.createElement('li'); | |
Item.innerHTML = "Brew!"; | |
list.insertBefore(item, list.firstChild); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>resting heart rate</title> | |
</head> | |
<body> | |
<button id="pulse">pulse</button> | |
<span id="bpm">click on each pulse</span> | |
<script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
options = { | |
chartArea: { | |
left: 20, | |
top: 40, | |
right: 10, | |
width: "90%", | |
height:"100%" | |
}, | |
legend: { | |
textStyle: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(100); |