Skip to content

Instantly share code, notes, and snippets.

View constanzaccg's full-sized avatar

Constanza Casquet constanzaccg

View GitHub Profile
@constanzaccg
constanzaccg / postman-script-jwt.js
Last active July 31, 2019 10:28
Postman - Pre-request Script with JWT (JsonWebToken)
function base64url(source) {
// Encode in classical base64
encodedSource = CryptoJS.enc.Base64.stringify(source);
// Remove padding equal characters
encodedSource = encodedSource.replace(/=+$/, '');
// Replace characters according to base64url specifications
encodedSource = encodedSource.replace(/\+/g, '-');
encodedSource = encodedSource.replace(/\//g, '_');
@constanzaccg
constanzaccg / export-import-github-labels.js
Last active February 23, 2021 18:18
Export labels from one repository and import them to another
/**
* EXPORT LABELS
* 1. Copy and paste the following code into the repository browser console that you want to get the labels
* 2. Copy the result
*/
let labels = [];
[].slice.call(document.querySelectorAll(".js-label-link"))
.forEach(function(element) {
labels.push({