This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html class="no-js" lang="en"> | |
<head> | |
<!-- Written by: jgilber (a.k.a., visualjeff on github) --> | |
<meta charset="utf-8" /> | |
<meta http-equiv="x-ua-compatible" content="ie=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>JWT Token Validator</title> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = crypto.subtle; | |
async function sha256(message) { | |
const msgBuffer = new TextEncoder('utf-8').encode(message); // encode as UTF-8 | |
const hashBuffer = await crypto.subtle.digest('SHA-256', msgBuffer); // hash the message | |
const hashArray = Array.from(new Uint8Array(hashBuffer)); // convert ArrayBuffer to Array | |
const hashHex = hashArray.map(b => ('00' + b.toString(16)).slice(-2)).join(''); // convert bytes to hex string | |
return hashHex; | |
} | |
let randomNumber = window.crypto.getRandomValues(new Uint32Array(1)); //Generate randomNumber and store in local storage. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const faker = require('faker'); | |
const testData = new Array(100).fill({}).map((v, i) => { | |
return { | |
name: faker.name.findName(), | |
address: faker.address.streetAddress(), | |
city: faker.address.city(), | |
state: faker.address.stateAbbr(), | |
postal: faker.address.zipCode(), | |
email: '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//You could use faker.js to generate some testData | |
function chunk(arr, chunkSize) { | |
const R = []; | |
for (let i = 0, len = arr.length; i < len; i += chunkSize) { | |
R.push(arr.slice(i, i + chunkSize)); | |
} | |
return R; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First, be sure make sure you've set your git user.name and user.email: | |
git config --global user.name "FIRST_NAME LAST_NAME" | |
git config --global user.email [email protected] | |
Create new local branch to work in: | |
git checkout -b v1.0.0 | |
Set version number in your project's package.json!!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For non-interactive login: | |
For a v2 Token: | |
https://login.microsoftonline.com/<<TENANT_NAME>>.onmicrosoft.com/oauth2/v2.0/authorize?response_type=id_token&scope=openid%20profile&client_id=<<CLIENT_ID>>&redirect_uri=https%3A%2F%2Fjwt.ms&nonce=null | |
For a v1 Token: | |
https://login.microsoftonline.com/common/oauth2/authorize?client_id=<<CLIENT ID>>&response_type=id_token&nonce=null | |
For an interactive login (if you need to set an initial password) for B2C: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Component from '@glimmer/component'; | |
export default class BlogPost extends Component { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Given an array of integers, return indices of the two numbers such that they add up to a specific target. | |
You may assume that each input would have exactly one solution, and you may not use the same element twice. | |
Example: | |
Given nums = [2, 7, 11, 15], target = 9, | |
Because nums[0] + nums[1] = 2 + 7 = 9, | |
return [0, 1]. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Note you may need to update the path to our sample data. | |
let data = require('./src/stories/menus/megaMenu/megamenu.json'); | |
const sortByName = (a, b) => { | |
return a.name > b.name ? 1 : b.name > a.name ? -1 : 0; | |
}; | |
// This function should be memoized for performance reasons. | |
const sortParent = (data) => { | |
let sortedData = [...data]; |