Skip to content

Instantly share code, notes, and snippets.

View therealmitchconnors's full-sized avatar
💭
💥 cramming for my demo

Mitch Connors therealmitchconnors

💭
💥 cramming for my demo
View GitHub Profile
@therealmitchconnors
therealmitchconnors / Grails.sublime-build
Created July 3, 2012 15:14
Sublime Build file for grails.
{
"cmd": ["grails", "compile"],
"working_dir": "${project_path}",
"file_regex": "^([^:\\n]+): (\\d+): (?=[^\\n]+\\n?\\W\\@ line \\d+, column (\\d+)\\.$)([^\\n]+)\\n? \\@",
"selector": "source.groovy",
"variants": [
{
"cmd": ["grails", "test-app", "$file_base_name"],
"name": "Run",
"file_regex": "(?=Failure: .+\\n\\|.*(?:\\n.*)*?\\s+at com\\.progauge\\.icp.com.+\\((.+\\..+):(\\d+)\\))()Failure: .+\\n\\|\\s*(.*)"
@therealmitchconnors
therealmitchconnors / FalloffBoundedQueue.java
Created January 31, 2013 19:06
This implementation of java.util.AbstractQueue is bounded, but always accepts additional members, with the oldest members simply 'falling off' silently if the queue is full. I am neither a java low-level expert, nor a creative commons license expert, so any improvement, whether to execution or attribution, would be most helpful.
/*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
* http://creativecommons.org/licenses/publicdomain
*/
package java.util;
import java.util.*;
/**
@therealmitchconnors
therealmitchconnors / gist:5292423
Created April 2, 2013 14:01
Conversation with Stack Overflow Expert 4/1/13
You are now talking to an expert. The transcript of your session will be available online.
Expert: Hello, can I help you with issues around pivoting 2 columns from 3 tables?
You: yeah, how do I do this?
Expert: That depends.
You: with depends? I don't think that's what I was going for...
apiVersion: v1
kind: Namespace
metadata:
creationTimestamp: "2019-04-30T22:23:22Z"
labels:
istio-injection: enabled
name: service-graph
spec: {}
status: {}
---
@therealmitchconnors
therealmitchconnors / galley.html
Created May 14, 2019 18:04
Galley doc file with viper config documented
---
title: galley
description: Galley provides configuration management services for Istio.
generator: pkg-collateral-docs
number_of_entries: 5
---
<p>Galley provides configuration management services for Istio.</p>
<table class="command-flags">
<thead>
<tr>
@therealmitchconnors
therealmitchconnors / frosted-flakes.py
Last active June 18, 2019 01:17
Parse Prow data for a given PR to detect likely flakes.
from google.cloud import storage # installed with `pip3 install google-cloud-storage`
import json
import re
# before running this file, you should be sure to have your gcloud
# credentials configured i.e. `gcloud auth application-default login`
# see https://cloud.google.com/compute/docs/tutorials/python-guide
prefix = 'pr-logs/pull/istio_istio/'
@therealmitchconnors
therealmitchconnors / gcloud-spanner-csv.sh
Last active July 10, 2020 01:23
Reads STDIN json, writes STDOUT csv
# converts spanner queries to csv on the command line
# input should be like `gcloud spanner databases execute-sql --format json`
STDIN=$(cat -)
echo $(echo "$STDIN"| jq '.metadata.rowType.fields[].name' | tr '\n' ', ')
rows=$(echo "$STDIN"| jq -r '.rows[] | @csv')
printf '%s\n' "${rows[@]}"
@therealmitchconnors
therealmitchconnors / viperconfig.go
Created August 12, 2019 23:25
Candidate Viperize Functions. Test Failing.
// Copyright 2019 Istio 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
//
// http://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,
@therealmitchconnors
therealmitchconnors / Dockerfile
Created April 17, 2020 05:13
Debug image for pilot, adaptable to pretty much any distroless go debugging
FROM golang:latest AS getter
RUN go get -u -v github.com/go-delve/delve/cmd/dlv
#COPY dlv .
FROM docker.io/therealmitchconnors/pilot:therealmitchconnors
EXPOSE 40000
COPY --from=0 /go/bin/dlv .
ENTRYPOINT ["./dlv", "--listen=:40000", "--headless=true", "--api-version=2", "exec", "/usr/local/bin/pilot-discovery", "--"]
// copyright
// standard generated code warning
package features
const (
traffic_circuitbreakers_failgracefully = "traffic.circuit-breakers.fail-gracefully"
observability = "observability"
usability_introspection_status_distribution_immidatelyfalse = "usability.introspection.status.distribution.immediately-false"