Skip to content

Instantly share code, notes, and snippets.

// Example in Typescript, nodejs reads a Google Doc if the service account is added as a viewer
// No manual OAUTH2 approval steps required. Just use the google share settings to share
// Use the client_email address found in the crendentials file as the
import fs = require('fs');
import {JWT, auth} from 'google-auth-library';
import {google} from 'googleapis';
const SCOPES = [
// Other options at
using UnityEngine;
public class MySceneBehaviour: MonoBehaviour {
private static MySceneParams loadSceneRegister = null;
public MySceneParams sceneParams;
public static void loadMyScene(MySceneParams sceneParams, System.Action<MySceneOutcome> callback) {
MySceneBehaviour.loadSceneRegister = sceneParams;
sceneParams.callback = callback;
tomlarkworthy / blogs.csv
Created December 7, 2021 08:40
Tables for Medium
notebook views likes
switch-dataflow 126 9
merge-dataflow 80 9
mip 62 27
sound-cloud-reactive-audio-visualizer 37 24
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Screenshotter : MonoBehaviour {
public TextMesh text;
public void Awake() {
float r = 1, g = 1, b = 1;
// Read r, g and b parameters passed into the query as <URL>?r=0.5?g=0?b=0.1
tomlarkworthy / Dockerfile
Last active January 21, 2021 13:17
USER root
RUN apk add --no-cache wget
USER camunda
RUN rm /camunda/lib/postgresql-9.3-1102-jdbc4.jar
RUN wget --directory-prefix=/camunda/lib
tomlarkworthy / Echo.bpmn
Last active May 13, 2020 12:33
Camunda at-least-once delivery
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="" xmlns:bpmndi="" xmlns:dc="" xmlns:camunda="" xmlns:di="" id="Definitions_0cqopu9" targetNamespace="" exporter="Camunda Modeler" exporterVersion="3.7.0">
<bpmn:process id="Echo" name="Echo" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:sequenceFlow id="Flow_0fjxlkl" sourceRef="StartEvent_1" targetRef="Gateway_0mt3mgo" />
<bpmn:callActivity id="PushPubsub" name="Publish Echo" camunda:asyncBefore="true" camunda:asyncAfter="true" camunda:exclusive="false" camunda:jobPriority="1" calledElement="PubsubPublish">
<camunda:in businessKey="#{execution.processBusinessKey}" />
# Cloud Run Camunda service
resource "google_cloud_run_service" "camunda" {
name = "camunda"
location = local.config.region
template {
spec {
# Use locked down Service Account
service_account_name =
containers {
image = null_resource.camunda_cloudsql_image.triggers.image
# Policy to allow public access to Cloud Run endpoint
data "google_iam_policy" "noauth" {
binding {
role = "roles/run.invoker"
members = ["allUsers"]
# Bind public policy to our Camunda Cloud Run service
resource "google_cloud_run_service_iam_policy" "noauth" {
# Build a customized image of Camunda to include the cloud sql postgres socket factory library
# Required to connect to Cloud SQL
# Built using Cloud Build, image stored in GCR
resource "null_resource" "camunda_cloudsql_image" {
triggers = {
# Rebuild if we change the base image or the local docker
image = "${local.project}/camunda_cloudsql:${local.config.base_image_tag}_${sha1(local_file.dockerfile.content)}"
provisioner "local-exec" {
command = <<-EOT
USER root
RUN apk add --no-cache wget
USER camunda
RUN rm /camunda/lib/postgresql-9.3-1102-jdbc4.jar
RUN wget --directory-prefix=/camunda/lib