Skip to content

Instantly share code, notes, and snippets.

@dalelane
dalelane / asyncapi-kafka-secure.yaml
Created November 27, 2020 11:21
secured Kafka cluster
asyncapi: 2.0.0
...
servers:
reallyproduction:
url: localhost:9092
description: Production server
protocol: kafka-secure
protocolVersion: '1.0.0'
security:
- saslScramCreds: []
@dalelane
dalelane / asyncapi-kafka-secure.yaml
Created November 27, 2020 11:19
secured Kafka cluster
asyncapi: 2.0.0
...
servers:
reallyproduction:
url: localhost:9092
description: Production server
protocol: kafka-secure
protocolVersion: '1.0.0'
security:
- creds: []
@dalelane
dalelane / asyncapi-kafkak8s.yaml
Created November 27, 2020 11:14
k8s kafka cluster in asyncapi
asyncapi: '2.0.0'
id: 'urn:uk:dalelane:kafka:simple-demo'
...
servers:
production:
url: dale-kafka-bootstrap-exp.apps.superfamicom.cp.fyre.ibm.com:443
protocol: kafka
protocolVersion: '1.0.0'
development:
url: dale-kafka-bootstrap-exp.apps.hartnell.cp.fyre.ibm.com:443
@dalelane
dalelane / asyncapi-kafkak8s.yaml
Last active November 27, 2020 11:13
k8s kafka cluster in asyncapi
asyncapi: '2.0.0'
id: 'urn:uk:dalelane:kafka:simple-demo'
...
servers:
production:
url: dale-kafka-bootstrap-exp.apps.superfamicom.cp.fyre.ibm.com:443
protocol: kafka
protocolVersion: '1.0.0'
@dalelane
dalelane / asyncapi-kafkacluster.yaml
Created November 27, 2020 11:00
kafka cluster in asyncapi
asyncapi: '2.0.0'
id: 'urn:uk:dalelane:kafka:simple-demo'
...
servers:
broker0:
url: dale-broker-0:9092
protocol: kafka
protocolVersion: '1.0.0'
broker1:
url: dale-broker-1:9092
@dalelane
dalelane / asyncapi-kafka.yaml
Created November 27, 2020 10:53
kafka cluster in asyncapi
asyncapi: 2.0.0
...
servers:
production:
url: localhost:9092
protocol: kafka
protocolVersion: '1.0.0'
description: I run a production server on my laptop
@dalelane
dalelane / asyncapi-servers.yaml
Created November 27, 2020 10:49
servers in asyncapi
asyncapi: 2.0.0
...
servers:
someserverdescription:
...
anotherservername:
...
@dalelane
dalelane / asyncapi-id.yaml
Created November 27, 2020 10:41
ids in asyncapi
asyncapi: '2.0.0'
id: 'urn:uk:co:dalelane:somedemo:weatherevents'
...
@dalelane
dalelane / install-eventstreams-operator.sh
Last active August 20, 2020 18:57
Installing the Event Streams Operator using the kubectl-operator plugin
#!/bin/bash
# This script uses the kubectl-operator plugin
# Install it using the instructions at https://github.com/operator-framework/kubectl-operator
# -----------------------------------------------------------------------
echo "Adding the IBM Common Services catalog source that provides pre-requisite operators"
oc operator catalog add \
@dalelane
dalelane / scratch-coordinate-sums.js
Last active July 21, 2019 00:57
Converting from Scratch's coordinates to the HTML canvas
// assumptions about the Scratch coordinate system
var SCRATCH_CANVAS_TOP = 180;
var SCRATCH_CANVAS_LEFT = -240;
var SCRATCH_CANVAS_RIGHT = 240;
var SCRATCH_CANVAS_WIDTH = SCRATCH_CANVAS_RIGHT - SCRATCH_CANVAS_LEFT;
// where is the top-left corner of the sprite we're interested in?
var costume = targetSprite.getCurrentCostume();
var scratchX = targetSprite.x - costume.rotationCenterX;
var scratchY = targetSprite.y + costume.rotationCenterY;