Skip to content

Instantly share code, notes, and snippets.

View mark05e's full-sized avatar

mark05E mark05e

View GitHub Profile
// postman-visualizer-filter-xpath
// INFO: The postman Visualizer feature allows response data to be displayed in a number of different ways. Pulling in external modules expands the capability even further. In the Visualize tab, to filter the response XML data returned in your requests.
// USAGE: Add this code as a part of pre-req or tests for your postman request
// REF: https://www.postman.com/odevodyssey/workspace/dev-odyssey-s-public-workspace/collection/7889102-cea7586b-169e-4372-895b-9e2e4ad8428f
// REF: https://community.postman.com/t/visualizer-and-xml/9969
let template = `
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
// postman-visualizer-filter-jsonpath
// INFO: The postman Visualizer feature allows response data to be displayed in a number of different ways. Pulling in external modules expands the capability even further. This demonstrates how you can use the jsonpath package, in the Visualize tab, to filter the response JSON data returned in your requests.
// USAGE: Add this code as a part of pre-req or tests for your postman request
// REF: https://www.postman.com/postman/workspace/postman-team-collections/request/1794236-b1c1129a-217b-4b47-8f7c-743dfd896dc4
// REF: https://community.postman.com/t/how-to-filter-response-based-on-specific-custom-field/11026/2
let template = `
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/jsonpath.min.js"></script>
@ECHO OFF
REM https://stackoverflow.com/questions/56928545/how-to-make-a-batch-file-react-differently-based-on-the-success-percent-of-a-pin
REM Ben Personick
@(
SetLocal EnableDelayedExpansion
ECHO OFF
SET "_PingAddress=www.aol.com"
SET "_Count=0"
)
@mark05e
mark05e / http_server.ps1
Last active July 10, 2022 20:39 — forked from nobodyguy/http_server.ps1
Powershell HTTP server in background thread (could be easily killed)
$listenerPort = "8007"
$ServerThreadCode = {
$listenerPort = $args[0]
$listener = New-Object System.Net.HttpListener
$listenerString = "http://+:$listenerPort/"
$listener.Prefixes.Add($listenerString)
$listener.Start()
while ($listener.IsListening) {
// from https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/azure-app-configuration/rest-api-postman.md
// TODO: Replace the following placeholders with your access key
var credential = "<Credential>"; // Id
var secret = "<Secret>"; // Value
var isBodyEmpty = pm.request.body === null || pm.request.body === undefined || pm.request.body.isEmpty();
var headers = signRequest(
pm.request.url.getHost(),
// check if we are inside GAS
// source - https://github.com/WildH0g/UnitTestingApp/blob/master/UnitTestingApp.js
function inGas() {
return typeof ScriptApp !== 'undefined';
}
// get the sheet ID from a url
// source - https://stackoverflow.com/questions/16840038/easiest-way-to-get-file-id-from-url-on-google-apps-script
function getIdFromUrl(url) {
try {
// postman-nice-codegen.js
// Mark05E
var log = false
var version = 0.6
var prefix = 'REQUEST'
var pm_request
var insidePostman = false

Clasp Notes

.clasp.json

{
	"scriptId":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
	"rootDir":"src"
}