Skip to content

Instantly share code, notes, and snippets.

View mattmoor's full-sized avatar
🤓
tinkering

Matt Moore mattmoor

🤓
tinkering
View GitHub Profile
@mattmoor
mattmoor / drop.yaml
Last active October 28, 2021 21:52
cosigned 2021-10-21
# Copyright 2021 The Sigstore Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@mattmoor
mattmoor / sign-with-gcloud.yaml
Created September 15, 2021 17:46
Tekton task to sign with gcloud credentials
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: sign-with-gcloud
spec:
params:
- name: digest
description: The digest to sign
steps:
@mattmoor
mattmoor / sign-with-ambient.yaml
Created September 15, 2021 17:45
Tekton task to sign with ambient creds
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: sign-with-ambient
spec:
params:
- name: digest
description: The digest to sign
steps:
source /Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash
gitp () {
# Get the target of a file rename
git status -s . | grep "^R " | cut -d'>' -f 2
# Open added or modified files, staged or not.
git status -s . | grep -vE "^ ?[DR?]" | sed 's/^...//g'
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
; Double Ctrl-C is always comment-region
(global-set-key (kbd "C-c C-c") 'comment-region)
func (c *Reconciler) reconcileFoo(parent *Parent) error {
// Get the current state of the Foo
foo, getFooErr := c.fooLister.Foos(ns).Get(name)
if apierrs.IsNotFound(getFooErr) {
// If it doesn’t exist, create it.
foo, err = c.createFoo(parent)
if err != nil {
return err
}
} else if getFooErr != nil {