Skip to content

Instantly share code, notes, and snippets.

@abhijitkane
abhijitkane / 0_reuse_code.js
Created December 30, 2013 15:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@abhijitkane
abhijitkane / test.postman_environment
Created August 4, 2015 19:13
Sample Postman Environment
{
"id": "0a95f7a4-7069-c204-3a92-32f9f2c570f2",
"name": "Test",
"values": [
{
"key": "username",
"value": "hello",
"type": "text"
},
{
firstName lastName
cooper sen
darth vader
@abhijitkane
abhijitkane / script_resolve.js
Created July 20, 2016 09:45
Resolving values in scripts
var url = request.url;
_.forIn(environment, function(index, key) {
url = url.replace(new RegExp("{{"+key+"}}", 'g'), environment[key]);
});
console.log(url);
@abhijitkane
abhijitkane / script-uuid.js
Created August 2, 2016 18:49
Create a guid in postman script
function S4() {
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
}
function guid() {
return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
}
var newGuid = guid();
@abhijitkane
abhijitkane / dbdump.js
Created October 23, 2017 17:21
App DB dump
pm.indexedDB.downloadAllData(pm.user.id, function() { pm.alerts.success('Saved');});
@abhijitkane
abhijitkane / petstore.json
Created December 3, 2018 17:23
Schemas in reverse order
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "Swagger Petstore",
"license": {
"name": "MIT"
}
},
"servers": [