Skip to content

Instantly share code, notes, and snippets.

View Topher-the-Geek's full-sized avatar

Topher Topher-the-Geek

View GitHub Profile
@Topher-the-Geek
Topher-the-Geek / gist:730dcca1808a44247aa338f1a65f28bd
Last active February 7, 2021 18:32
PHP app to show HTTP headers when served through AWS ALB/EKS
# Simple PHP app served through AWS Application Load Balancer to Kubernetes cluster.
# Assumes you have setup a Kubernetes cluster with AWS Load Balancer Controller and External DNS
# https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/
# https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/aws.md
# https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/alb-ingress.md
# There's a couple place holders near the bottom to be filled in.
apiVersion: v1
kind: ConfigMap
metadata:
@Topher-the-Geek
Topher-the-Geek / PingPongChannelInitializer.java
Created September 27, 2013 14:43
Ping Pong in Netty 4.0.
package example;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
import io.netty.handler.codec.LengthFieldPrepender;
import io.netty.handler.codec.string.StringDecoder;
import io.netty.handler.codec.string.StringEncoder;
import io.netty.util.CharsetUtil;
@Topher-the-Geek
Topher-the-Geek / FixturesSpec.scala
Created April 13, 2012 17:06
Monadic Test Fixtures for Scalatest
/*
* Copyright 2012, Christopher A. Olson
*
* 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
@Topher-the-Geek
Topher-the-Geek / Sample.scala
Created January 27, 2011 14:24
@cpsParam seems to thwart implicit conversion
package org.me.sundry
import org.specs.Specification
import org.specs.mock.Mockito
import scala.util.continuations._
class ContinuationTests extends Specification with Mockito {
class Rendezvous[T] {
private trait State {