Skip to content

Instantly share code, notes, and snippets.

@eouw0o83hf
eouw0o83hf / regexml.js
Created December 28, 2014 21:49
Javascript Simple Regex XML Parse
function tagRegExp(tag) {
return new RegExp("<" + tag + ">((.|[\r\n])*?)<\/" + tag + ">", "gmi")
}
function getElements(data, tag) {
var groups = data.match(tagRegExp(tag));
var output = [];
for(var i = 0; i < groups.length; ++i) {
var matches = tagRegExp(tag).exec(groups[i]);
if(matches.length >= 2) {
@eouw0o83hf
eouw0o83hf / gist:5b87c167c8d8059f6030
Last active August 29, 2015 14:09
High-Entropy Memorable Password Generator
const int WordCount = 7;
const int MinLength = 3;
const int MaxLength = 8;
void Main()
{
var parsed = words
.Split('\n')
.Select(a => a.Trim())
.Where(a => a.Length >= MinLength && a.Length <= MaxLength)

Keybase proof

I hereby claim:

  • I am eouw0o83hf on github.
  • I am eouw0o83hf (https://keybase.io/eouw0o83hf) on keybase.
  • I have a public key whose fingerprint is 71B0 2A06 DD4E 308F 8824 2797 3D98 0BEB C020 71BF

To claim this, I am signing this object: