https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
extract in your home directory
Then at the end of your .bashrc
export JAVA_HOME="$HOME/jdk1.8.0_201"
function testIntegration(executor, timeout) { | |
let timer; | |
const timeoutPromise = new Promise((resolve, reject) => { | |
timer = setTimeout(() => { | |
console.log("timing out"); | |
screenshot(); | |
reject("timeout"); | |
}, timeout); | |
}); | |
const testPromise = new Promise((resolve, reject) => { |
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
extract in your home directory
Then at the end of your .bashrc
export JAVA_HOME="$HOME/jdk1.8.0_201"
const list = [1,1,2,3,5,5,5,5,10,62,95,107,109,202]; | |
function search(list, num) { | |
// console.log("Searching for :", num, "LIST:", list) | |
let mid = ~~(list.length / 2); | |
let item = list[mid]; | |
if (item === num) { | |
return {isFound:true, num}; | |
} |
// Given a stack object of microservices to deploy, | |
// implement a deploy function that takes this object | |
// with a provided variable syntax, and runs the | |
// referenced microservice functions in order | |
// according to microservice dependencies. | |
const sleep = async (wait) => new Promise((resolve) => setTimeout(() => resolve(), wait)) | |
const supportedServices = { | |
database: async (inputs) => { |
var x = function() { | |
return new Promise ((resolve,reject) => { | |
console.log("performing x"); | |
setTimeout(() => { | |
resolve(10) | |
}, 2000) | |
}) | |
} | |
var y = function() { | |
return new Promise ((resolve,reject) => { |
var x = new Promise ((resolve,reject) => { | |
setTimeout(() => { | |
resolve(10) | |
}, 200) | |
}) | |
var y = new Promise ((resolve,reject) => { | |
setTimeout(() => { | |
resolve(2) | |
}, 1000) |
class MyComponent extends Nanocomponent { | |
constructor(config) { | |
super(); | |
this.ready = new Promise((resolve, reject) => { | |
this._resolve = resolve; | |
}) | |
} | |
createElement(params) { | |
// do stuff | |
} |
// only polyfill .finished in browsers that already support animate() | |
if (document.body.animate) { | |
// Chrome does not seem to expose the Animation constructor globally | |
if (typeof Animation === 'undefined') { | |
window.Animation = document.body.animate({}).constructor; | |
} | |
if (Animation.prototype.finished === undefined) { | |
Object.defineProperty(Animation.prototype, 'finished', { |
// app.js | |
var html = require('choo/html') | |
var choo = require('choo') | |
var app = choo() // 1. | |
app.route('/', view) // 2. | |
app.route('/second', second) // 2. | |
app.mount('body') // 3. |