Skip to content

Instantly share code, notes, and snippets.

@toopay
toopay / new-table.sql
Created January 8, 2021 20:15
connect-new-table
DROP TABLE IF EXISTS `email_template`;
CREATE TABLE IF NOT EXISTS `email_template` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`template_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`category` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`can_aggregate` tinyint(1) NOT NULL DEFAULT '0',
@toopay
toopay / drain.sh
Last active October 1, 2019 14:40
drain.sh
#!/bin/bash
concurrency_count=2
# Ensure to have correct current-context on your kubeconfig
KUBECONFIG=~/.kube/config
nodes_draining(){
ps -ef |grep "[k]ubectl drain"
return $?
}
@toopay
toopay / newman-reporter-curl.js
Created October 22, 2018 14:22
newman-reporter-curl.js
var CurlReporter;
/**
* Simple reporter that generates a curl statement
*
* @param {Object} newman - A run object with event handler specification methods.
* @param {Function} newman.on - An event setter method that provides hooks for reporting collection run progress.
* @param {Object} reporterOptions - A set of reporter specific run options.
* @param {Object} options - A set of generic collection run options.
* @returns {*}
'create_user' => '24b3cb9f-635c-11e8-aa57-d8cb8a18931c',
'remove_user' => '7702d2b2-a56b-11e8-8430-00155d731728',
'create_user_flow' => '978b16b9-6368-11e8-aa57-d8cb8a18931c',
'edit_user_flow' => '3d832d6e-6369-11e8-aa57-d8cb8a18931c',
'get_user_flows' => 'b0d7074f-636b-11e8-aa57-d8cb8a18931c',
'get_user_flow_by_id' => 'ae332308-9105-11e8-842f-00155d731728',
'get_contact_flows' => '9c81eeb5-7bb0-11e8-842e-00155d731728',
'activate_user_flow' => 'dd3138ff-7bfe-11e8-842e-00155d731728',
'deactivate_user_flow' => '69c237f0-7bff-11e8-842e-00155d731728',
'get_flow_contacts' => '5ab62ab1-7bb2-11e8-842e-00155d731728',
@toopay
toopay / config.yml
Last active June 27, 2018 11:49
Connect API Kongfig
# Mandatory Consumer
consumers:
- acls: []
credentials: []
custom_id: "0"
username: anonymous
apis:
# Main Endpoint
- attributes:
methods:
@toopay
toopay / kongfig-api.md
Last active June 18, 2018 14:07
Kongfig API (via Kong Publisher)

Overview

Kong Publisher exposes a public APIs. Here are the base endpoint of Kong Publisher API, on each environment accordingly.

Environment Base Endpoint
develop https://dev-kong-publisher.command-api.kw.com/api
qa https://qa-kong-publisher.command-api.kw.com/api
production https://kong-publisher.command-api.kw.com/api
@toopay
toopay / kongfig-schema.md
Last active September 1, 2020 09:44
Kongfig Schema

Overview

Kongfig allow declarative configuration. We can define our list of APIs and consumers in json/yaml and then run kongfig to ensure that our Kong is configured correctly. At the simplest form, your config.yml can be just :

---
  apis:
    -
 name: "mockbin"
@toopay
toopay / kongfig.md
Last active June 6, 2018 17:21
Kongfig and Kong Publisher Documentation

Overview

Kongfig allow declarative configuration. We can define our list of APIs and consumers in json/yaml and then run kongfig to ensure that our Kong is configured correctly. Kong Publisher is an interface that use Kongfig to allow us manage the upstream, build the routes and back-up the entire Kong data as snapshot.

Kongfig Schema

At the simplest form, your config.yml can be just :

---
  apis:
 -
@toopay
toopay / project.py
Created March 1, 2017 08:10
PyGithub extension
"""
project.py
~~~~~~~~
Extending Github repo class to allow project access
:author: Taufan Aditya
"""
import github
@toopay
toopay / index.html
Last active October 3, 2016 07:53
BixBox SDK Example
<html>
<head>
<title>SDK Test</title>
</head>
<body>
<div style="display:inline;"><bixbox:login onlogin="check" size="large"></bixbox:login></div>
<script>
function check() {
bixbox.check(function(response) {
statusCallback(response);