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
var request = require("request"); | |
var fs = require("fs"); | |
// this options object is constructed based on the network calls the web application at https://events.rainfocus.com/catalog/oracle/oow17/catalogoow17 is making to its backend API | |
var options = { | |
method: 'POST', | |
url: 'https://events.rainfocus.com/api/search', | |
headers: | |
{ | |
'cache-control': 'no-cache', | |
'content-type': 'application/x-www-form-urlencoded' |
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
var express = require('express'); | |
var path = require('path'); | |
var favicon = require('serve-favicon'); | |
var logger = require('morgan'); | |
var cookieParser = require('cookie-parser'); | |
var bodyParser = require('body-parser'); | |
var routes = require('./routes/index'); | |
var users = require('./routes/users'); |
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
<template> | |
<div class="sourceselection"> | |
<div> | |
<div class="jumbotron"> | |
<h2><span class="glyphicon glyphicon-list-alt"></span> News List</h2> | |
<h4>Select News Source</h4> | |
<input v-model="source" list="newssources-list" v-on:input="sourceChanged" | |
name="source-selection" id="source-selection" class="form-control" | |
placeholder="Please specify news source ..."/> | |
<datalist id="newssources-list"> |
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
var countriesDocumentURL = "https://raw.githubusercontent.com/mledoze/countries/master/countries.json" | |
request(countriesDocumentURL, async function (error, response, body) { | |
var countries = JSON.parse(body) | |
// get unique region values (see: https://codeburst.io/javascript-array-distinct-5edc93501dc4) | |
// take all elements in the countries array, for each of them: take the region element; create a Set of all the resulting region values (a Set contains unique elements) | |
var regions = [...new Set(countries.map(country => country.region))] | |
var subregions = [...new Set(countries.map(country => country.subregion))] | |
// see https://stackoverflow.com/questions/39837678/why-no-array-prototype-flatmap-in-javascript for this flatMap function | |
const flatMap = (f, xs) => |
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
// asynchronous generator - read in await for..of loop | |
const sleep = (milliseconds) => { | |
return new Promise(resolve => setTimeout(resolve, milliseconds)) | |
} | |
const lg = (msg) => { | |
const d = new Date() | |
console.log(`${d.getSeconds()}:${d.getMilliseconds()} - ${msg}`) | |
} | |
const alphabet = async function* () { |
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
const sleep = (milliseconds) => { | |
return new Promise(resolve => setTimeout(resolve, Math.floor(milliseconds))) | |
} | |
const lg = (msg) => { | |
const d = new Date() | |
console.log(`${d.getSeconds()}.${Math.round(d.getMilliseconds() / 100)} - ${msg}`) | |
} | |
// each sensor has a slightly randomized timeput period, suggesting a different and somewhat varying production rate of measurements |
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
const sleep = (milliseconds) => { | |
return new Promise(resolve => setTimeout(resolve, Math.floor(milliseconds))) | |
} | |
const lg = (msg) => { | |
const d = new Date() | |
console.log(`${d.getSeconds()}.${Math.round(d.getMilliseconds() / 100)} - ${msg}`) | |
} | |
// each sensor has a slightly randomized timeput period, suggesting a different and somewhat varying production rate of measurements |
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
const sleep = (milliseconds) => { | |
return new Promise(resolve => setTimeout(resolve, Math.floor(milliseconds))) | |
} | |
const lg = (msg) => { | |
const d = new Date() | |
console.log(`${d.getSeconds()}.${Math.round(d.getMilliseconds() / 100)} - ${msg}`) | |
} | |
// each sensor has a slightly randomized timeput period, suggesting a different and somewhat varying production rate of measurements |
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
const sleep = (milliseconds) => { | |
return new Promise(resolve => setTimeout(resolve, Math.floor(milliseconds))) | |
} | |
const lg = (msg) => { | |
const d = new Date() | |
console.log(`${d.getSeconds()}.${Math.round(d.getMilliseconds() / 100)} - ${msg}`) | |
} | |
// each sensor has a slightly randomized timeput period, suggesting a different and somewhat varying production rate of measurements |
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
#!/bin/bash | |
# in order to run, first install jq with: sudo apt-get install jq | |
oci() { docker run --rm --mount type=bind,source=$HOME/.oci,target=/root/.oci stephenpearson/oci-cli:latest "$@"; } | |
# set global variable OKE_COMPARTMENT_ID with the OCID for the compartment with name passed in $1 | |
set_oke_compartment() | |
{ | |
echo set_oke_compartments for $1 | |
compartments=$(oci iam compartment list --compartment-id $ROOT_COMPARTMENT_ID --all) | |
# echo "Compartments: $compartments" |
OlderNewer