$ docker
This file contains 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
using System.IdentityModel.Tokens; | |
// a sample jwt encoded token string which is supposed to be extracted from 'Authorization' HTTP header in your Web Api controller | |
var tokenString = "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik1uQ19WWmNBVGZNNXBPWWlKSE1iYTlnb0VLWSJ9.eyJhdWQiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC8wMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiLCJpYXQiOiIxNDI4MDM2NTM5IiwibmJmIjoiMTQyODAzNjUzOSIsImV4cCI6IjE0MjgwNDA0MzkiLCJ2ZXIiOiIxLjAiLCJ0aWQiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiLCJhbXIiOiJwd2QiLCJvaWQiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiLCJlbWFpbCI6Impkb2VAbGl2ZS5jb20iLCJwdWlkIjoiSm9obiBEb2UiLCJpZHAiOiJsaXZlLmNvbSIsImFsdHNlY2lkIjoiMTpsaXZlLmNvbTowMDAwMDAwMDAwMDAwMDAwIiwic3ViIjoieHh4eHh4eHh4eHh4eHh4eC15eXl5eSIsImdpdmVuX25hbWUiOiJKb2huIiwiZmFtaWx5X25hbWUiOiJEb2UiLCJuYW1lIjoiSm9obiBEb2UiLCJncm91cHMiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiLCJ1bmlxdWVfbmFtZSI6ImxpdmUuY29tI2pkb2VAbGl2ZS5jb2 |
This file contains 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
{ | |
"workbench.startupEditor": "none", | |
"workbench.sideBar.location": "right", | |
"editor.fontFamily": "Fira Code, Menlo, Monaco, 'Courier New', monospace", | |
"editor.fontSize": 17, | |
"editor.suggestFontSize": 16, | |
"editor.suggestLineHeight": 28, | |
"editor.renderWhitespace": "all", | |
"editor.fontLigatures": true, | |
"editor.lineHeight": 25, |
This file contains 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
fetchData = () => { | |
const urls = [ | |
"https://jsonplaceholder.typicode.com/posts/1", | |
"https://jsonplaceholder.typicode.com/posts/2", | |
"https://jsonplaceholder.typicode.com/posts/3", | |
"https://jsonplaceholder.typicode.com/posts/4", | |
"https://jsonplaceholder.typicode.com/posts/5", | |
"https://jsonplaceholder.typicode.com/posts/6", | |
"https://jsonplaceholder.typicode.com/posts/7", | |
"https://jsonplaceholder.typicode.com/posts/8" |
This file contains 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
<% if (process.env.NODE_ENV == 'production') { %> | |
<script src="https://cdn.ravenjs.com/3.26.2/raven.min.js" crossorigin="anonymous"></script> | |
<script>Raven.config('https://ba44729431a044d6915d8012e94d8a56@sentry.io/1230983', { | |
environment: "%NODE_ENV%", | |
}).install(); | |
</script> | |
<% } %> |
git reset $(git commit-tree HEAD^{tree} -m 'Initial commit')
This is a suggested workflow for building npm modules locally. The particular context will be focused on building a React component lib, but the workflow can be applied for any npm module.
yarn link
is a really great tool for local development. It builds a global npm module that
is symlinked to your local repo. So when you make a change to the repo, the global module is
automatically updated.
_yarn link
and npm link
do the same thing, but store the global module in a different location.
This file contains 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
function nextEvent(target, name) { | |
return new Promise(resolve => { | |
target.addEventListener(name, resolve, { once: true }); | |
}); | |
} | |
// Example with getUserMedia() | |
const stream = await navigator.mediaDevices.getUserMedia({ | |
video: true, |
This file contains 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
function getMsg(val) { | |
if (val === 'x') { | |
return 'y'; | |
} else if (val === 'y') { | |
return 'x'; | |
} else if (val === 'a') { | |
return 'b'; | |
} else { | |
return ''; | |
} |
OlderNewer