Skip to content

Instantly share code, notes, and snippets.

Nick Glynn 17twenty

Block or report user

Report or block 17twenty

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@17twenty
17twenty / docker-compose.yml
Created Sep 14, 2017
As a way to get Zookeeper / Kafka AND Kafka Manager working together in docker compose...
View docker-compose.yml
version: '2'
services:
zookeeper:
hostname: zookeeper
image: wurstmeister/zookeeper
ports:
- "2181:2181"
kafka:
hostname: kafka
image: wurstmeister/kafka:0.9.0.0-1
@17twenty
17twenty / reflectAllTheThings.go
Created Aug 25, 2017
Building things from names using reflect and Golang
View reflectAllTheThings.go
package main
import (
"log"
"reflect"
)
var objectMap = make(map[string]reflect.Type)
type MyString struct {
@17twenty
17twenty / crazyOlSelectCase.go
Last active Aug 10, 2019
Using reflect.SelectCase - an example
View crazyOlSelectCase.go
package main
import (
"log"
"reflect"
"time"
)
func main() {
c1 := make(chan int)
@17twenty
17twenty / cheatsheet.md
Created Aug 24, 2017
Docker - A Cheatsheet
View cheatsheet.md

Docker Cheatsheet

Docker Registries & Repositories

Login to a Registry

docker login
docker login localhost:8080
@17twenty
17twenty / mail.html
Created Aug 21, 2017
Email Markup for newsletters
View mail.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Signup for my newsletter</title>
<style type="text/css">
body{
margin: 0 auto;
padding: 0;
@17twenty
17twenty / consulservicediscovery.go
Created Aug 4, 2017
Want to find things from your Golang apps in Consul?
View consulservicediscovery.go
package main
import (
"fmt"
"log"
consul "github.com/hashicorp/consul/api"
)
// Client provides an interface for getting data out of Consul
@17twenty
17twenty / ipmath.go
Created Jun 28, 2017
IP Address math
View ipmath.go
package ipmath
import (
"crypto/sha1"
"encoding/binary"
"math"
"net"
)
//ToUInt32 converts an IPv4 address into
@17twenty
17twenty / ratelimitMyCopy.go
Created Jun 14, 2017
Demo of using golang.org x time rate RateLimiter
View ratelimitMyCopy.go
package main
import (
"bytes"
"fmt"
"io"
"time"
"golang.org/x/time/rate"
)
@17twenty
17twenty / git.sh
Created Mar 30, 2017
Wrapper script that can specify an ssh-key file with the Git command
View git.sh
#!/bin/bash
#-------------------------------------------------------------------------------
# Wrapper script that can specify an ssh-key file with the Git command
#
# The MIT License (MIT) - http://opensource.org/licenses/MIT
# Copyright (c) 2013 Alvin Abad
#-------------------------------------------------------------------------------
if [ $# -eq 0 ]; then
@17twenty
17twenty / ecs-cluster.tf
Last active Mar 23, 2017
Terraform Docker Injection - You can override the docker config this way - useful for custom BIP / CIDRs
View ecs-cluster.tf
...
# Fetch the AWS ECS Optimized Linux AMI. Note that if you've never launched this AMI before, you have to accept the
# terms and conditions on this webpage or the EC2 instances will fail to launch:
# https://aws.amazon.com/marketplace/pp/B00U6QTYI2
data "aws_ami" "ecs" {
most_recent = true
owners = ["amazon"]
filter {
name = "name"
You can’t perform that action at this time.