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
console.log("<<ES6 features in iojs default runtime>>"); | |
console.log(process.versions); | |
(function letVariable() { | |
"use strict"; | |
// "let" only allow in strict mode | |
var i = 0; | |
{ | |
let i = 10; | |
console.log("[let]let i:", i); |
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
// ES6 class and structure | |
// iojs --es_staging classes.js | |
"use strict"; | |
class A { | |
constructor () { | |
this.a = true; | |
} | |
isSuper() { |
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
// $ npm install http2 | |
// $ iojs server-with-push.js | |
// open "https://localhost:8080/" with FirefoxDeveloperEdition (37.0a2) | |
var fs = require("fs"); | |
// openssl ecparam -genkey -name secp3841r1 -out ecdsa.key | |
// openssl req -new -key ecdsa.key -out ecdsa.req | |
// openssl req -x509 -key ecdsa.key -in ecdsa.req -out ecdsa.cer | |
var options = { | |
key: fs.readFileSync("./ecdsa.key"), |
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 TinyPromise = require("./promise"); | |
//var TinyPromise = Promise; | |
// utilities | |
var wait = function (ms) { | |
return function waiting(v) { | |
return new TinyPromise(function (f, r) {setTimeout(f, ms, v);}); | |
}; | |
}; | |
var timeout = function (ms) { |
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
web: npm start |
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> | |
<meta charset="utf-8" /> | |
<title>User Media</title> | |
<script src="script.js"></script> | |
</head> | |
<body> | |
<div id="camera"></div> | |
<div id="shot"></div> |
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
"use strict"; | |
var A4 = { | |
E: [0,1,2,3], I: [1,0,3,2], J: [2,3,0,1], K: [3,2,1,0], | |
S: [2,0,1,3], T: [],U: [],V: [], | |
W: [1,2,0,3], X: [],Y: [],Z: [], | |
}; | |
var mul = function(a, b) { | |
return [a[b[0]], a[b[1]], a[b[2]], a[b[3]]]; |
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
import javafx.application.Application; | |
import javafx.stage.Stage; | |
import javafx.scene.Scene; | |
import javafx.scene.control.Label; | |
import javafx.scene.layout.BorderPane; | |
public class HelloWorld extends Application { | |
@Override | |
public void start(Stage stage) throws Exception { |
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
web: npm start |
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
web: npm start |