Skip to content

Instantly share code, notes, and snippets.

@lucassouza1
Created June 24, 2016 18:15
Show Gist options
  • Save lucassouza1/26167930af9e8ad0ca33723bc3bea6ae to your computer and use it in GitHub Desktop.
Save lucassouza1/26167930af9e8ad0ca33723bc3bea6ae to your computer and use it in GitHub Desktop.
Parameters
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Parameters</title>
<style>
body {
display: flex;
flex-direction: column;
font-family: monospace;
}
div, textarea {
border: 1px solid #333;
flex: 1;
font: inherit;
margin: 8px;
padding: 8px;
overflow-wrap: break-word;
}
</style>
</head>
<body>
<h1>Parameters</h1>
<textarea onkeyup="parse()"></textarea>
<div></div>
<script>
function parse() {
document.querySelector('div').innerText = document.querySelector('textarea').value
.split('&')
.filter(x => !x.endsWith('active=0'))
.map(x => (/.*:(.*=.+)/).exec(x))
.filter(x => x)
.map(x => x[1])
.filter(x => (/^[^:]+$/).test(x))
.join('\n');
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment