Skip to content

Instantly share code, notes, and snippets.

View hello.ts
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`)) {
View kopf.py
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']
View http.go
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 Aug 29, 2017
Blank page for iTunes store.
View itunes.log
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
View client.go
// 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 Jan 18, 2016
Predictions for NBA games on Jan 18 2016. Using last 15 games. Negative mov, means home team wins.
View nba-2016-01-18
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
Installing Jekyll
View lol-ruby
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...
View gist:10135618
#!/usr/bin/env python
# Quick and dirty demonstration of CVE-2014-0160 by
# Jared Stafford (jspenguin@jspenguin.org)
# Modified so that it finds cookies
import sys
import struct
import socket
import time
import select
View riakshell.go
// tim$ go install
// tim$ cat logs | riakshell
package main
import (
"bufio"
"github.com/mrb/riakpbc"
"io"
"log"
View artie.conf
# Artie - Artie Server
#
# Real-time messaging service
description "artie"
start on filesystem
stop on runlevel S
respawn