Skip to content

Instantly share code, notes, and snippets.

View hermanbanken's full-sized avatar
🇳🇱

Herman hermanbanken

🇳🇱
View GitHub Profile
@hermanbanken
hermanbanken / Dockerfile
Last active April 22, 2024 10:53
Compiling NGINX module as dynamic module for use in docker
FROM nginx:alpine AS builder
# nginx:alpine contains NGINX_VERSION environment variable, like so:
# ENV NGINX_VERSION 1.15.0
# Our NCHAN version
ENV NCHAN_VERSION 1.1.15
# Download sources
RUN wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz && \
@hermanbanken
hermanbanken / kustomize_vars.md
Created November 22, 2020 13:11
Kustomize Vars example

This was initially posted in an kubernetes-sigs/kustomize issue.

We are using Kustomize's vars feature. Initially we didn't understand how to use it for our purpose, but it is a 100% fit. One example is our Ingress resource, which looks like this:

# file: base/ingress.yaml
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: services
@hermanbanken
hermanbanken / go.mod
Last active July 5, 2023 14:38
Datastore pagination bugreport fixed
module github.com/hermanbanken/datastore-pagination-bugreport
go 1.19
replace cloud.google.com/go/datastore => github.com/hermanbanken/google-cloud-go/datastore v1.5.1-0.20230705143622-a2a6954dde9a
require (
cloud.google.com/go/datastore v1.12.0
github.com/smartystreets/assertions v1.13.1
google.golang.org/api v0.126.0
@hermanbanken
hermanbanken / go.mod
Last active July 5, 2023 14:21
Datastore pagination bugreport
module github.com/hermanbanken/datastore-pagination-bugreport
go 1.19
require (
cloud.google.com/go/datastore v1.12.0
github.com/smartystreets/assertions v1.13.1
google.golang.org/api v0.126.0
)
@hermanbanken
hermanbanken / _index.md
Last active February 15, 2023 21:36
Funda image downloading
@hermanbanken
hermanbanken / go.mod
Created February 6, 2023 16:33
Download Google Cloud Trace as JSON
module github.com/q42philips/trace-export
go 1.19
require cloud.google.com/go/trace v1.8.0
require (
cloud.google.com/go/compute v1.14.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
@hermanbanken
hermanbanken / _README.md
Last active January 9, 2023 23:00
Datastore Emulator consistency

TLDR: The datastore emulator has a consistency setting. When developing, always set this to a value to 0.05 or lower to simulate realistic eventual consistency.

The Google Datastore is only partly consistent: only lookups and ancestor queries are strongly consistent. All types of queries use the indexes, which take a while to process in a distributed system like Google Datastore. When you develop an application that uses the Datastore, it helps to use the emulator in a way that simulates this eventual consistency. This way to can test if your

@hermanbanken
hermanbanken / BottomUpScrollable.tsx
Last active June 14, 2022 07:13
Screen that is glued to the bottom of the screen if there is enough space, or a regular scroll view if it does not fit
import React, {useCallback, useRef, useState} from 'react';
import {
Pressable,
RefreshControl,
SafeAreaView,
ScrollView,
StyleSheet,
Text,
View,
} from 'react-native';
@hermanbanken
hermanbanken / .gitignore
Last active June 7, 2022 21:36
Music concert generation of overlay slides
slides.html
slides.pdf
import * as functions from "firebase-functions" // The Cloud Functions for Firebase SDK to create Cloud Functions and set up triggers.
import { Firestore } from "@google-cloud/firestore"; // Cloud Firestore: Node.js Client
import * as admin from "firebase-admin"; // The Firebase Admin SDK to access Firestore.
admin.initializeApp();
const db = admin.firestore();
const adminUSA = new Firestore({projectId:"firestoreusa"}); // Firebase USA access account
const collections = ["bridges", "users", "tokens"];