Skip to content

Instantly share code, notes, and snippets.

View hermanbanken's full-sized avatar
🇳🇱

Herman hermanbanken

🇳🇱
View GitHub Profile
@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 / 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"];
FROM node:alpine
COPY server.js /srv/www/
COPY server.js.map /srv/www/
ENV API_URL=http://example.com NODE_OPTIONS=--enable-source-maps
ENTRYPOINT [ "node", "/srv/www/server.js" ]
@hermanbanken
hermanbanken / bootstramp.yaml
Last active May 17, 2022 22:02
Envoy xDS syntax highlighting with https://github.com/redhat-developer/vscode-yaml Extension
# yaml-language-server: $schema=https://github.com/jcchavezs/envoy-config-schema/releases/download/v1.21.0/v3_Bootstrap.json
node:
id: "something"
cluster: "some-cluster"
metadata:
any: {}
key: can
be: used-here
locality:
zone: "europe-west4-a"
@hermanbanken
hermanbanken / README.md
Last active March 18, 2022 15:01
Middleware

Sadly we can't have nice things in TypeScript (see https://www.ackee.agency/blog/typescript). Specifically middleware that:

  1. Notifies when the chain is broken
pipe(
   () => 21,
   (n: number) => n * 2,
 (n: string) => n.repeat(5), // Error: number is not assignable to string