Skip to content

Instantly share code, notes, and snippets.

View soundstep's full-sized avatar
💭
There is a difference between a peasant and a knight

Romuald Quantin soundstep

💭
There is a difference between a peasant and a knight
View GitHub Profile
{
"info": {
"_postman_id": "41598fbc-9770-47d3-930e-6d0a491e8e00",
"name": "Pact bi-directional",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "659145"
},
"item": [
{
"name": "POST discovery PRD",
openapi: 3.0.3
info:
title: ITV - Pact bi-directional
version: 1.0.0
contact: {}
servers:
- url: http://example.com
paths:
/discovery:
get:
openapi: 3.0.3
info:
title: Pact bi-directional
version: 1.0.0
contact: {}
servers:
- url: http://example.com
paths:
/discovery:
post:
@soundstep
soundstep / output
Created August 11, 2022 10:08
Deno semver
semver.inc("1.0.0", "patch") >>> 1.0.1
semver.inc("1.0.0", "minor") >>> 1.1.0
semver.inc("1.0.0", "major") >>> 2.0.0
--- prepatch ---
semver.inc("1.0.0", "prepatch") >>> 1.0.1-0
semver.inc("1.0.0-itvx", "prepatch", "itvx") > 1.0.1-itvx.0
semver.inc("1.0.0-itvx.0", "prepatch", "itvx") > 1.0.1-itvx.0
--- preminor ---
semver.inc("1.0.0", "preminor") >>> 1.1.0-0
semver.inc("1.0.0-itvx", "preminor", "itvx") > 1.1.0-itvx.0
import sodium from 'https://esm.sh/libsodium-wrappers@0.7.10?deno-std=0.160.0';
console.log(sodium);
import sodium from 'https://cdn.skypack.dev/libsodium-wrappers@0.7.10?dts';
console.log(sodium);
@soundstep
soundstep / status.js
Created March 3, 2023 11:50
Goreplay
const gor = require('goreplay_middleware');
const fs = require('fs');
// `init` will initialize STDIN listener
gor.init();
// Example of very basic way to compare if replayed traffic have no errors
gor.on('request', function (req) {
gor.on('response', req.ID, function (resp) {
gor.on('replay', req.ID, function (repl) {
if (gor.httpStatus(resp.http) != gor.httpStatus(repl.http)) {