Skip to content

Instantly share code, notes, and snippets.

@psucodervn
psucodervn / spec.yaml
Created June 18, 2021 02:41
Coinduit API Spec
openapi: 3.0.0
info:
description: Conduit API
version: 1.0.0
title: Conduit API
contact:
name: RealWorld
url: https://realworld.io
license:
name: MIT License
{
"openapi": "3.0.0",
"info": {
"title": "Swagger Petstore",
"version": "1.0.0",
"contact": {}
},
"paths": {
"/": {
"get": {
{
"openapi": "3.0.0",
"info": {
"title": "Swagger Petstore",
"version": "1.0.0",
"contact": {}
},
"paths": {
"/docs/{doc}": {
"get": {
openapi: 3.0.0
info:
title: Swagger Petstore
version: 1.0.0
contact: {}
paths:
'/docs/{doc}':
get:
summary: ''
description: ''
@psucodervn
psucodervn / tag.sh
Created December 16, 2019 12:32
tag
#!/bin/bash
#get highest tag number
VERSION=`git describe --abbrev=0 --tags`
#replace . with space so can split into an array
VERSION_BITS=(${VERSION//./ })
#get number parts and increase last one by 1
VNUM1=${VERSION_BITS[0]-0}
@psucodervn
psucodervn / .lua
Created November 26, 2019 02:36
Kong auto ssl redirect
local scheme = kong.request.get_scheme()
if scheme == "http" then
local host = kong.request.get_host()
local query = kong.request.get_path_with_query()
local url = "https://" .. host ..query
kong.response.set_header("Location",url)
return kong.response.exit(302,url)
end
@psucodervn
psucodervn / docker-compose.yml
Created November 9, 2019 08:04 — forked from pantsel/docker-compose.yml
example docker-compose.yml for kong, postgres and konga
version: "3"
networks:
kong-net:
driver: bridge
services:
#######################################
# Postgres: The database used by Kong
@psucodervn
psucodervn / monqua.cpp
Last active June 17, 2019 12:03
MONQUA.CPP
#include <bits/stdc++.h>
using namespace std;
vector<int> v;
void generate(int N) {
int b[] = {3, 5, 7};
int a[] = {3, 5, 7};
v.push_back(3); v.push_back(5); v.push_back(7);
kubectl --namespace kube-system create serviceaccount tiller

kubectl create clusterrolebinding tiller-cluster-rule \
 --clusterrole=cluster-admin --serviceaccount=kube-system:tiller

kubectl --namespace kube-system patch deploy tiller-deploy \
 -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}' 
id name address index txHash blockNumber blockHash txIndex removed arguments createdAt updatedAt
3 TeamCreated 0xb5a737114e58dbed5389c4e2f2a902751f388899 15 0xe4d5524fbeccf609ad67e2655d358c474c247647c492a2bbb9d743d227cea77d 4799641 0xec991ce642a7d32ded4768265a50f14efd4c919e6f5f178d7fd75283ea800a27 30 0 {"owners":["0xe4033c8c54557a01da8461c1a0fe9f4d81c69f3a","0xbdab60e9644aaa9c9f11f3fc06f439e8d125525f"],"contractAddress":"0xb5a737114e58dbed5389c4e2f2a902751f388899","id":"1f87c09babd2101d16881c131ff6c5bf"} 2019-01-10 15:40:33.197780 2019-01-10 15:40:33.197780
4 TeamCreated 0xb5a737114e58dbed5389c4e2f2a902751f388899 15 0xe4d5524fbeccf609ad67e2655d358c474c247647c492a2bbb9d743d227cea77d 4799641 0xec991ce642a7d32ded4768265a50f14efd4c919e6f5f178d7fd75283ea800a27 30 1 {"owners":["0xe4033c8c54557a01da8461c1a0fe9f4d81c69f3a","0xbdab60e9644aaa9c9f11f3fc06f439e8d125525f"],"contractAddress":"0xb5a737114e58dbed5389c4e2f2a902751f388899","id":"1f87c09babd2101d16881c131ff6c5bf"} 2019-01-10 15:40:36.661326 2019-01-10 15:40:36.