- It retrieves the name of the default branch from the remote repository using the
git ls-remote
command. - It checks out the
default
branch locally. - It lists all local branches using the
git for-each-ref
command. - For each local branch, it finds the merge base between the default branch and the current branch using the
git merge-base
command. - It creates a temporary commit tree for the current branch using the
git commit-tree
command. - It checks if the temporary commit is a descendant of the default branch using the
git cherry
command. - If the temporary commit is not a descendant (i.e., the branch has been merged into the default branch), it prints a message indicating that the branch can be deleted.
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
FROM python:3.12.0-slim-bullseye AS build | |
RUN apt-get update && apt-get install -y gcc | |
ENV POETRY_VIRTUALENVS_IN_PROJECT=true \ | |
POETRY_NO_INTERACTION=1 \ | |
POETRY_VIRTUALENVS_OPTIONS_NO_SETUPTOOLS=1 | |
RUN pip install "poetry>=1.8" | |
WORKDIR /app |
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 | |
# source: https://gist.github.com/LucasRoesler/c7b245bcd9f33bc989e279ba9cdb9828 | |
# usage: | |
# create-repo name [owner] | |
# create-repo name # owner defaults to contiamo | |
# name is the first arg, fallback to the the current directory name | |
NAME="$1" | |
OWNER=${2:-contiamo} |
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
import { S3Client } from "@aws-sdk/client-s3"; | |
import { streamingWrite, Upload } from "./writer"; | |
const sleep = (ms: number) => { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
}; | |
// skip because it requires a real s3 bucket, this is still useful for testing locally. | |
describe.skip("streamingWriter", () => { |
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
kubectl create namespace openfaas-fn | |
kubectl create namespace openfaas | |
kubectl -n openfaas create secret generic basic-auth \ | |
--from-literal=basic-auth-user=admin \ | |
--from-literal=basic-auth-password=localdev | |
helm upgrade lucas-of openfaas/openfaas \ | |
--install \ | |
--namespace openfaas \ | |
--set basic_auth=true \ | |
--set functionNamespace=openfaas-fn \ |
To clear 307 HSTS redirects in Google Chrome (if you experimenting with SSL -- you probably wouldn't want to do this for a site that you do not opperate, since it is there to protect you), go to the following URL and delete the site.
chrome://net-internals/#hsts
- Start the KinD env and disable auth. In the
faas-netes
project
make start-kind
export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
helm upgrade openfaas --install ./chart/openfaas \
--namespace openfaas \
--set basic_auth=false \
--set openfaasImagePullPolicy=IfNotPresent \
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
#!/usr/bin/env bash | |
# reset environment variables that could interfere with normal usage | |
export GREP_OPTIONS= | |
# put all utility functions here | |
# make a temporary file | |
git_extra_mktemp() { | |
mktemp -t "$(basename "$0")".XXX | |
} |
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
// ListenAndServeMonitoring starts up an HTTP server serving /metrics and /health. | |
// | |
// When the context is cancelled, the server will be gracefully shutdown. | |
func ListenAndServeMonitoring(ctx context.Context, addr string, healthHandler http.Handler) error { | |
srv := monitoringServer(addr, healthHandler) | |
go func() { | |
<-ctx.Done() | |
shutdownContext, cancel := context.WithTimeout(context.Background(), 1*time.Second) | |
defer cancel() |
NewerOlder