Skip to content

Instantly share code, notes, and snippets.

View bryanl's full-sized avatar
🚩
Out in the streets

Bryan Liles bryanl

🚩
Out in the streets
View GitHub Profile
[I] ➜ go tool pprof http://localhost:3001/debug/pprof/heap
Fetching profile over HTTP from http://localhost:3001/debug/pprof/heap
Saved profile in /Users/bryan/pprof/pprof.alloc_objects.alloc_space.inuse_objects.inuse_space.013.pb.gz
Type: inuse_space
Time: Aug 1, 2019 at 3:28pm (EDT)
Entering interactive mode (type "help" for commands, "o" for options)
(pprof) top
Showing nodes accounting for 676.12MB, 90.43% of 747.64MB total
Dropped 171 nodes (cum <= 3.74MB)
Showing top 10 nodes out of 94
@bryanl
bryanl / campfire-emoji.txt
Created January 27, 2011 16:34
campfire emoji
Surround these with : e.g. :calling:
+1
-1
bulb
calling
clap
cop
email
feet
package objectstore
import (
"sync"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"github.com/vmware/octant/third_party/k8s.io/client-go/dynamic/dynamicinformer"
/*
Copyright (c) 2019 VMware, Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package main
import (
"context"
"fmt"
/*
Copyright (c) 2019 VMware, Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package main
import (
"context"
"fmt"
func (dc *DynamicCache) Update(ctx context.Context, key store.Key, mutator func(*unstructured.Unstructured) error) error {
if mutator == nil {
return errors.New("can't update object")
}
err := kretry.RetryOnConflict(kretry.DefaultRetry, func() error {
object, err := dc.Get(ctx, key)
if err != nil {
return err
}
{
"title": [
{
"metadata": {
"type": "text"
},
"config": {
"value": "Deployment"
}
},
package main
type KeyPair struct {
Key string
Value []byte
}
type KeyStore interface {
Get(k string) (*KeyPair, error)
}
import * as kdux from 'kdux';
kdux.Configure(config => {
config.commonLabels = {
project: "project-1"
};
config.commonAnnotations = {
onCallEmail: "email@example.com"
};
local params = std.extVar('__ksonnet/params').components['site-ingress'];
local svcParams = std.extVar('__ksonnet/params').components['site-service'];
local deployParams = std.extVar('__ksonnet/params').components['site-deployment'];
{
apiVersion: 'extensions/v1beta1',
kind: 'Ingress',
metadata: {
annotations: {
'kubernetes.io/ingress.class': 'contour',