Skip to content

Instantly share code, notes, and snippets.

@asoorm
asoorm / template
Created February 8, 2018 17:41
slideshow
{
"slideshow": {
"author": "{{ index .slideshow "-author" }}",
"date": "{{ index .slideshow "-date" }}",
"title": "{{ index .slideshow "-title" }}",
"slide": [
{{ range $k, $slide := .slideshow.slide }}{{ if $k }},{{ end }}{
"type": "{{ index $slide "-type" }}",
"item": [{{ range $ki, $item := $slide.item }}{{ if $ki }},{{ end }}
"{{ $item }}"
@asoorm
asoorm / index.html
Created February 5, 2018 15:11
Portal Homepage example
{{ define "indexPage" }}
{{ template "header" .}}
<body>
{{ template "navigation" . }}
@asoorm
asoorm / books.xml
Created February 5, 2018 10:37
XML collection of books
<?xml version="1.0"?>
<catalog>
<book id="0134190440">
<author>Donovan, A &amp; Kerninghan B</author>
<title>The Go Programming Language</title>
<genre>Computing</genre>
<price>20.54</price>
<publish_date>2015-10-26</publish_date>
<description>The Go Programming Language is the authoritative resource
for any programmer who wants to learn Go. It shows how to write clear
@asoorm
asoorm / gist:b47b922c75f8114e1d18328e7ef49a65
Created January 24, 2018 09:18
example starting tyk gateway with Docker
$ docker run -d --rm --name tyk_gateway -p 8080:8080 -v $(pwd)/tyk.bosch.json:/opt/tyk-gateway/tyk.conf tykio/tyk-gateway
681f095baec84bf2339a468fbe2e4879df636565e1678751b70dfb38eea749fb
$ docker logs --follow tyk_gatewaysed: cannot rename /opt/tyk-gateway/sedCinfWv: Device or resource busy
sed: cannot rename /opt/tyk-gateway/sed1oPpZy: Device or resource busy
time="Jan 24 09:10:19" level=info msg="Connection dropped, reconnecting..."
time="Jan 24 09:10:19" level=info msg="PIDFile location set to: /var/run/tyk-gateway.pid"
time="Jan 24 09:10:19" level=info msg="Initialising Tyk REST API Endpoints"
time="Jan 24 09:10:19" level=info msg="--> Standard listener (http)" port=":8080"
time="Jan 24 09:10:19" level=info msg="Setting up Server"
@asoorm
asoorm / gist:0614db343aeb326c7fd6214a4324b896
Created January 23, 2018 21:37
Tyk Analytics - Available properties
{
"_id" : ObjectId("5a67a9d2f5985b94c44bcf6e"),
"method" : "GET",
"path" : "headers",
"rawpath" : "headers",
"contentlength" : NumberLong(0),
"useragent" : "PostmanRuntime/7.1.1",
"day" : 23,
"month" : 1,
"year" : 2018,
package main
//$ go test --bench . -benchmem
//BenchmarkBase64DecodeString-4 1000000 1781 ns/op 992 B/op 2 allocs/op
//--- BENCH: BenchmarkBase64DecodeString-4
// b64_test.go:19: decode len 516
// b64_test.go:19: decode len 516
// b64_test.go:19: decode len 516
// b64_test.go:19: decode len 516
//BenchmarkBase64DecodeString2-4 5000 250250 ns/op 147456 B/op 2 allocs/op