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
/** | |
* Queries the Insights for Twitter service. Expects a "twitterinsights" service | |
* bound to the app. | |
*/ | |
public class TwitterCollector extends Collector { | |
private GetWithThrottle get = new GetWithThrottle(); | |
static final SimpleDateFormat postedFormat = new SimpleDateFormat( | |
"yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.ENGLISH); |
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
{ | |
"search": { | |
"results": 1, | |
"current": 1 | |
}, | |
"tweets": [ | |
{ | |
"cde": { | |
"author": { | |
"gender": "male", |
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
// http://twcservice.mybluemix.net/rest-api/ | |
var defaultOptions = { | |
language: "en-US", | |
units: "e" | |
}; | |
var callByGeolocation = function (endPoint, latitude, longitude, options, callback) { | |
options = _.merge({}, defaultOptions, options); | |
var callURL = url + endPoint + |
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 | |
# Get the OpenWhisk CLI | |
mkdir ~/wsk | |
curl https://openwhisk.ng.bluemix.net/cli/go/download/linux/amd64/wsk > ~/wsk/wsk | |
chmod +x ~/wsk/wsk | |
export PATH=$PATH:~/wsk | |
# Configure the OpenWhisk CLI | |
wsk property set --apihost openwhisk.ng.bluemix.net --auth "${OPENWHISK_AUTH}" --namespace "${CF_ORG}_${CF_SPACE}" |
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 | |
OPENWHISK_API_HOST=openwhisk.ng.bluemix.net | |
ACCESS_TOKEN=`cat ~/.cf/config.json | jq -r .AccessToken | awk '{print $2}'` | |
REFRESH_TOKEN=`cat ~/.cf/config.json | jq -r .RefreshToken` | |
ORG_NAME=`cat ~/.cf/config.json | jq -r .OrganizationFields.Name` | |
SPACE_NAME=`cat ~/.cf/config.json | jq -r .SpaceFields.Name` | |
ALL_KEYS=`curl -XPOST -k -d "{ \"accessToken\" : \"$ACCESS_TOKEN\", \"refreshToken\" : \"$REFRESH_TOKEN\" }" \ | |
-H 'Content-Type:application/json' https://$OPENWHISK_API_HOST/bluemix/v2/authenticate` |
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 | |
# get the latest terraform | |
curl -LO "https://releases.hashicorp.com/terraform/$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M '.current_version')/terraform_$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M '.current_version')_linux_amd64.zip" | |
unzip terraform*.zip | |
rm -f terraform*.zip | |
chmod 755 terraform | |
./terraform version | |
# get the latest IBM Cloud provider | |
curl -LO $(curl -I https://github.com/IBM-Cloud/terraform-provider-ibm/releases/latest | grep Location | awk '{print $2}' | sed 's/tag/download/g' | tr -d '[:space:]')/linux_amd64.zip |
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
apiVersion: serving.knative.dev/v1alpha1 | |
kind: Service | |
metadata: | |
name: lw-erp | |
namespace: default | |
labels: | |
knative.dev/type: "app" | |
spec: | |
runLatest: | |
configuration: |
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
apiVersion: serving.knative.dev/v1alpha1 | |
kind: Service | |
metadata: | |
name: lw-controller | |
namespace: default | |
labels: | |
knative.dev/type: "app" | |
spec: | |
runLatest: | |
configuration: |
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
# similar to Dockerfile, but uses Apache HTTPd and does not use multi-stage build | |
FROM httpd:2.4 | |
ARG CONTROLLER_SERVICE=http://lw-controller:8080 | |
ENV CONTROLLER_SERVICE="${CONTROLLER_SERVICE}" | |
RUN echo "Using ${CONTROLLER_SERVICE}" | |
WORKDIR /app | |
COPY . . |
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
# build | |
FROM node:6-alpine AS build | |
WORKDIR /app | |
COPY . . | |
ARG CONTROLLER_SERVICE=http://lw-controller:8080 | |
ENV CONTROLLER_SERVICE="${CONTROLLER_SERVICE}" | |
RUN cd /app \ |
OlderNewer