Skip to content

Instantly share code, notes, and snippets.

View timstclair's full-sized avatar

Tim Allclair (St. Clair) timstclair

View GitHub Profile
@timstclair
timstclair / keybase.md
Last active May 12, 2017 00:22
keybase.md

Keybase proof

I hereby claim:

  • I am timstclair on github.
  • I am tallclair (https://keybase.io/tallclair) on keybase.
  • I have a public key ASAAeiPDxluYJ66KzhExqN10FK5w0mkqRych6TzR4WoGRAo

To claim this, I am signing this object:

@timstclair
timstclair / loader.yaml
Last active November 18, 2022 23:23
AppArmor loader 1-click
apiVersion: v1
kind: ConfigMap
metadata:
name: apparmor-profiles
data:
docker-default-audit: |-
#include <tunables/global>
profile docker-default-audit flags=(attach_disconnected,mediate_deleted) {
@timstclair
timstclair / gopath.sh
Created July 7, 2016 23:16
GOPATH function
# A function for managing multiple Go projects in separate directory hierarchies
# Usage: gogo <project name>
# Exports variables for use by other scripts or PS1:
# __G_PROJECT - aliased project name
# __G_PROJECT_DIR - path to project directory in go source tree
function gogo() {
local PROJECT="$1"
local PROJECT_DIR=""
local BASE="$HOME/go/$PROJECT"
@timstclair
timstclair / godoc-bookmarklet.md
Last active July 7, 2016 23:09
Godoc Bookmarklet

GoDoc Bookmarklet

A bookmarklet to navigate from a go repository (e.g. https://github.com/stretchr/testify) to the corresponding godoc page.

To install:

  1. Create a new bookmark (in Chrome, right-click bookmarks bar > Add page...)
  2. Name it anything you want (I use GoDoc)
  3. Copy the following into the URL:
/*
Copyright 2014 The Kubernetes Authors All rights reserved.
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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@timstclair
timstclair / dynamic_select_test.go
Created September 3, 2015 18:12
Select from a dynamic list of channels
package scratch
import (
"reflect"
"testing"
)
/*
Results with Go1.5 on a 6 core Xeon CPU E5-1650 0 @ 3.20GHz
@timstclair
timstclair / dynamic_select_test.go
Last active June 9, 2022 07:15
Benchmark aggregating channels vs. reflect.Select
package scratch
import (
"reflect"
"testing"
)
const numProduce = 1000
const numChannels = 100
const expectedResult int64 = numChannels * numProduce * (numProduce - 1) / 2
diff --git a/pkg/api/v1/conversion_generated.go b/pkg/api/v1/conversion_generated.go
index d98300a..91b2b68 100644
--- a/pkg/api/v1/conversion_generated.go
+++ b/pkg/api/v1/conversion_generated.go
@@ -1472,6 +1472,68 @@ func convert_api_PodProxyOptions_To_v1_PodProxyOptions(in *api.PodProxyOptions,
return nil
}
+func convert_api_PodSpec_To_v1_PodSpec(in *api.PodSpec, out *PodSpec, s conversion.Scope) error {
+ if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {