Skip to content

Instantly share code, notes, and snippets.

View CloudyCity's full-sized avatar
🎯
Focusing

CloudyCity

🎯
Focusing
View GitHub Profile
@bcnzer
bcnzer / postman-pre-request.js
Last active May 14, 2024 08:23
Postman pre-request script to automatically get a bearer token from Auth0 and save it for reuse
const echoPostRequest = {
url: 'https://<my url>.auth0.com/oauth/token',
method: 'POST',
header: 'Content-Type:application/json',
body: {
mode: 'application/json',
raw: JSON.stringify(
{
client_id:'<your client ID>',
client_secret:'<your client secret>',
@stiekel
stiekel / ksort.js
Created April 28, 2015 05:13
JavaScript ksort
function ksort(obj){
var keys = Object.keys(obj).sort()
, sortedObj = {};
for(var i in keys) {
sortedObj[keys[i]] = obj[keys[i]];
}
return sortedObj;
}