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
<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 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 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 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at | |
# https://docs.vagrantup.com. | |
# Every Vagrant development environment requires a box. You can search for | |
# boxes at https://atlas.hashicorp.com/search. |
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
version: '2' | |
services: | |
zookeeper: | |
image: "confluentinc/cp-zookeeper:4.1.0" | |
hostname: zookeeper | |
ports: | |
- "2181:2181" | |
environment: | |
ZOOKEEPER_CLIENT_PORT: 2181 |
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
#!/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" |
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
Export the OCID of the root compartment: | |
export ROOT_COMPARTMENT_ID=ocid1.tenancy.oc1..aaaaaaaaot | |
Create a new OKE policy in the root compartment of your tenancy: | |
oci iam policy create --name oke-service --compartment-id $ROOT_COMPARTMENT_ID --statements '[ "allow service OKE to manage all-resources in tenancy"]' --description 'policy for granting rights on OKE to manage cluster resources' | |
List all policies, to verify the success of the creation: | |
oci iam policy list --compartment-id $ROOT_COMPARTMENT_ID --all | |
Now create a special compartment for all OKE resources |
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 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 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 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 |
OlderNewer