Skip to content

Instantly share code, notes, and snippets.

View asoorm's full-sized avatar

Ahmet Soormally asoorm

View GitHub Profile
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
@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,
@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 / 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 / index.html
Created February 5, 2018 15:11
Portal Homepage example
{{ define "indexPage" }}
{{ template "header" .}}
<body>
{{ template "navigation" . }}
@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 / path-match-with-regex.json
Created February 22, 2018 09:59
Tyk API Definition - Path Match With Regex
{
"name": "Path Match with Regex",
"active": true,
"api_id": "1",
"org_id": "1",
"slug": "path-match-with-regex",
"definition": {
"location": "",
"key": ""
},
@asoorm
asoorm / keyless.json
Created March 4, 2018 12:00
Example Keyless Tyk Gateway API Definition
{
"name": "Keyless HttpBin",
"api_id": "1",
"org_id": "default",
"use_keyless": true,
"auth": {
"auth_header_name": ""
},
"version_data": {
"not_versioned": true,
@asoorm
asoorm / protected.json
Created March 4, 2018 12:04
Example Auth-Token Protected API Definition for Tyk API Gateway
{
"name": "AuthToken HttpBin",
"api_id": "1",
"org_id": "default",
"auth": {
"auth_header_name": "Authorization"
},
"version_data": {
"not_versioned": true,
"versions": {
@asoorm
asoorm / session-token.json
Created March 4, 2018 12:05
Example Tyk CE session token
{
"allowance": 1000,
"rate": 1000,
"per": 60,
"expires": -1,
"quota_max": -1,
"quota_renews": 1406121006,
"quota_remaining": 0,
"quota_renewal_rate": 60,
"access_rights": {