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'; | |
const { Worker, isMainThread, parentPort, workerData } = require('worker_threads'); | |
const min = 2 | |
function generatePrimes(start, range) { | |
const primes = [] | |
let isPrime = true; | |
let end = start + range; | |
for (let i = start; i < end; 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
'use strict'; | |
const min = 2 | |
function main(params) { | |
const { start, end } = params | |
console.log(params) | |
const primes = [] | |
let isPrime = true; | |
for (let i = start; i < end; 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
const openwhisk = require('openwhisk'); | |
const main = async evt => { | |
const count = (evt.count || 0) + 1 | |
// use client library to retrieve current function configuration | |
const ow = openwhisk() | |
const action = await ow.actions.get('counter') | |
// update default parameters with new value |
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 openwhisk = require('openwhisk'); | |
var request = require('request-promise'); | |
function getNextSunrise(lat, lng, when) { | |
const options = { | |
uri: 'https://api.sunrise-sunset.org/json', | |
qs: { lat: lat, lng: lng, when: when }, | |
json: true | |
} |
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
$ docker run -p 5601:5601 -p 9200:9200 -p 5000:5000 -it --name old_elk sebp/elk:es241_l240_k461 |
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
FROM openwhisk/dockerskeleton:latest | |
ADD actionproxy.py /actionProxy/ |
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
input { | |
stdin { | |
type => "stdin-type" | |
} | |
tcp { | |
port => 5000 | |
type => syslog | |
} | |
udp { | |
port => 5000 |
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
FROM openwhisk/python3action | |
# lapack-dev is available in community repo. | |
RUN echo "http://dl-4.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories | |
# add package build dependencies | |
RUN apk add --no-cache \ | |
g++ \ | |
lapack-dev \ | |
gfortran |
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
[package] | |
name = "action" | |
version = "0.1.0" | |
authors = ["Me <me@email.com>"] | |
[dependencies] | |
rustc-serialize = "0.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
extern crate rustc_serialize; | |
use rustc_serialize::json; | |
use rustc_serialize::json::Json; | |
use std::env; | |
#[derive(RustcDecodable, RustcEncodable)] | |
pub struct Greeting { | |
message: String | |
} |