This file contains hidden or 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
| function skip15sec(){ | |
| var player = document.querySelector("audio"); | |
| player.currentTime = player.currentTime + 15; | |
| } | |
| function rewind15sec(){ | |
| var player = document.querySelector("audio"); | |
| player.currentTime = player.currentTime - 15; | |
| } |
This file contains hidden or 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
| function draw(){ | |
| ctx.fillStyle = "rgb(32, 32, 32)"; | |
| ctx.fillRect(0, 0, canvas.width, canvas.height); | |
| var data = [20, 40, 50, 60, 30, 10, 20, 40, 70, 5, -1, -20, -5, -20, -7, -5, 5]; | |
| ctx.fillStyle = "rgb(255, 255, 255)"; | |
| var i = 0; | |
| var offset = 5; | |
| var width = (canvas.width - offset * (data.length + 1))/ data.length; |
This file contains hidden or 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
| function getMinute(min, after){ | |
| return (min + after) % 60; | |
| } | |
| function getHour(hour, after){ | |
| return (hour + after) % 24; | |
| } |
This file contains hidden or 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
| function add(a, b){ | |
| return a + b; | |
| } | |
| function subtract(a, b){ | |
| return a - b; | |
| } | |
| function multiply(a, b){ | |
| return a * b; |
This file contains hidden or 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
| function addTwo(a){ | |
| b = a + 1; | |
| return a + 1; | |
| } | |
| c = addTwo(1); | |
| /* | |
| 2 | |
| */ | |
| d = c + b; |
This file contains hidden or 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
| function addOne(a){ | |
| return a + 1; | |
| } | |
| function addTwo(a){ | |
| var b = addOne(a); | |
| return addOne(b); | |
| } | |
| addTwo(1); |
This file contains hidden or 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
| function getData(url){ | |
| return new Promise((resolve, reject) => { | |
| console.log("download " + url); | |
| var req = new XMLHttpRequest({mozSystem: true}); | |
| req.open("GET", url, true); | |
| req.overrideMimeType("audio/mp4"); | |
| req.responseType = "blob"; | |
| req.onload = () => { | |
| console.log("downloaded"); | |
| resolve(req.response); |
This file contains hidden or 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
| alert("gistからの刺客"); | |
| var div = $("<div></div>"); | |
| div.css({width: "100%", height: window.innerHeight + "px", position: "fixed", top: 0, left: 0}); | |
| div.appendTo($("body")); |
This file contains hidden or 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
| body{ | |
| margin: 0; | |
| padding: 0; | |
| } | |
| #canvas{ | |
| width: 100%; | |
| height: 400px; | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; |
This file contains hidden or 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
| navigator.getUserMedia = | |
| navigator.getUserMedia || navigator.mozGetUserMedia; | |
| const SIZE = { | |
| width: 800, | |
| height: 600 | |
| }; | |
| var storage; | |
| var elements; |