Skip to content

Instantly share code, notes, and snippets.

@pims
pims / envoy.yaml
Created January 24, 2024 20:48
envoy stats
stats_config:
stats_matcher:
exclusion_list:
patterns:
- suffix: upstream_cx_length_ms #statsd format
histogram_bucket_settings:
- match:
suffix: upstream_rq_time
# defaul buckets with 600000,1800000,3600000 dropped
buckets: [0.5,1,5,10,25,50,100,250,500,1000,2500,5000,10000,30000,60000,300000]
@pims
pims / app.py
Last active January 3, 2024 20:26
Example of running a python script via python-wasi using the wasmtime wasm runtime
print("hello from a python script")
[
"abogado",
"ac",
"academy",
"accountant",
"accountants",
"actor",
"ad",
"adult",
"ae",
@pims
pims / hello.ts
Last active March 29, 2021 20:48
function handleRequest(request) {
const NAME = "experiment-0"
// The Responses below are placeholders. You can set up a custom path for each test (e.g. /control/somepath ).
const TEST_RESPONSE = new Response("Test group") // e.g. await fetch("/test/sompath", request)
const CONTROL_RESPONSE = new Response("Control group") // e.g. await fetch("/control/sompath", request)
// Determine which group this requester is in.
const cookie = request.headers.get("cookie")
if (cookie && cookie.includes(`${NAME}=control`)) {
import kopf
import kubernetes
import yaml
@kopf.on.create('zalando.org', 'v1', 'databases')
def create_fn(body, spec, **kwargs):
# Get info from Database object
name = body['metadata']['name']
namespace = body['metadata']['namespace']
type = spec['type']
@pims
pims / http.go
Created December 13, 2019 21:45
var httpClient = &http.Client{
Timeout: defaultHTTPTimeout,
// There is a bug in Go's HTTP/2 implementation that occasionally causes it
// to send an empty body when it receives a `GOAWAY` message from a server:
//
// https://github.com/golang/go/issues/32441
//
// This is particularly problematic for this library because the empty body
// results in no parameters being sent, which usually results in a 400,
@pims
pims / itunes.log
Created August 29, 2017 05:39
Blank page for iTunes store.
Aug 28 21:34:01 home-2 com.apple.usbmuxd[103]: error MuxTCPSendNextSegmentOverNetwork Unexpected EOF, client 21-iTunes:0 -> 1-fe80::1ce6:e723:fbee:7396:0:0
Aug 28 21:34:02 home-2 com.apple.usbmuxd[103]: error MuxTCPSendNextSegmentOverNetwork Unexpected EOF, client 37-iTunes:0 -> 1-fe80::1ce6:e723:fbee:7396:0:0
Aug 28 21:34:02 home-2 com.apple.usbmuxd[103]: error MuxTCPSendNextSegmentOverNetwork Unexpected EOF, client 43-iTunes:0 -> 1-fe80::1ce6:e723:fbee:7396:0:0
Aug 28 21:34:02 home-2 com.apple.usbmuxd[103]: error MuxTCPSendNextSegmentOverNetwork Unexpected EOF, client 51-iTunes:0 -> 1-fe80::1ce6:e723:fbee:7396:0:0
Aug 28 21:34:04 home-2 com.apple.usbmuxd[103]: error MuxTCPSendNextSegmentOverNetwork Unexpected EOF, client 10-iTunes:0 -> 1-fe80::1ce6:e723:fbee:7396:0:0
Aug 28 21:34:07 home-2 com.apple.usbmuxd[103]: error MuxTCPSendNextSegmentOverNetwork Unexpected EOF, client 78-iTunes:0 -> 1-fe80::1ce6:e723:fbee:7396:0:0
Aug 28 21:34:09 home-2 com.apple.usbmuxd[103]: error MuxTCPS
// Copyright 2015 The Gorilla WebSocket Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build ignore
package main
import (
"flag"
@pims
pims / nba-2016-01-18
Created January 18, 2016 08:57
Predictions for NBA games on Jan 18 2016. Using last 15 games. Negative mov, means home team wins.
phi @ nyk
mov -10.0
tot 208.0
uta @ cha
mov -12.0
tot 192.0
por @ was
mov -2.0
tot 206.0
nor @ mem
@pims
pims / lol-ruby
Created May 8, 2014 04:25
Installing Jekyll
tim@tim ~> gem install jekyll
Fetching: liquid-2.5.5.gem (100%)
Successfully installed liquid-2.5.5
Fetching: fast-stemmer-1.0.2.gem (100%)
Building native extensions. This could take a while...
Successfully installed fast-stemmer-1.0.2
Fetching: classifier-1.3.4.gem (100%)
Successfully installed classifier-1.3.4
Fetching: ffi-1.9.3.gem (100%)
Building native extensions. This could take a while...