Skip to content

Instantly share code, notes, and snippets.

View luanmuniz's full-sized avatar
:octocat:
Always Building

Luan Muniz luanmuniz

:octocat:
Always Building
View GitHub Profile
@luanmuniz
luanmuniz / jwtRS512.sh
Last active December 16, 2018 20:37 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
openssl genrsa -aes128 -out cert.key 4096
openssl rsa -in cert.key -pubout -out cert.pub
cat cert.key
cat cert.pub
function getTagFromHtmlText(html, tagFind, attrFind, attrValueFind, returnResult, all){
html = html || '',
reg = '';
if(all === undefined){
all = false;
}
html = html.replace(/<!--[\s\S]*?-->/g, ''); // remove comments
if(attrFind === undefined || attrFind === false){
reg = new RegExp('<'+tagFind+'\\b[^>]*(\\1)([^>]*/>|[^>]*>((?:(?:(?!<'+tagFind+'[^>]*>|<\/'+tagFind+'>)[\\s\\S])+|<'+tagFind+'[^>]*>([\\s\\S]*?)<\/'+tagFind+'>)*)<\/'+tagFind+'>)','gi');