Skip to content

Instantly share code, notes, and snippets.

@josher19
Created February 21, 2013 07:52
Show Gist options
  • Save josher19/5003012 to your computer and use it in GitHub Desktop.
Save josher19/5003012 to your computer and use it in GitHub Desktop.
outp=(inp="<html>Documentation Permission is hereby granted, free of charge, to any person obtaining a copy of this Software and associated Documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</html> {:ABC:} , 123456.").replace(/([^A-Za-z0-9 ]+)/g, " {:$1:} ").replace(/([A-Z]+)/g," {:$1:} ").split(" ").map(function (it,n) { return it.length > 10 ? it.substring(0,10) + " {::} " + it.substring(10) : parseInt(it, 36) || it}) .join(" ").split(" ") .map(function(it,n) { return it.match(/^\d/) ? (+it).toString(36) : it }).join(" ").replace(/ \{\:([^a-z ]*)\:} /g, function(all,m) { return m.toUpperCase() }); [outp, inp == outp]
@josher19
Copy link
Author

seq = [1, 1, -1, 1]
randsort = function (a,b) { return seq[seq.n++ % seq.length]; }
j += 1; for(i=0; i < 100 && !(res.join("") === TARGET) || i == 0; ++i) { seq.n=0; res=res.sort(randsort) };
(480 iterations for res.length=28)

outp=(inp="Documentation Permission is hereby granted, free of charge, to any person obtaining a copy of this Software and associated Documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: {:ABC:} , 123456.").replace(/([^A-Za-z0-9 ]+)/g, " '$1' ").replace(/([A-Z]+)/g," '$1' ").split(" ").map(spitter=function (it,n) { return it.length > 10 ? spitter(it.substring(0,10)) + " '' " + spitter(it.substring(10)) : parseInt(it, 36)/256 || it}) .join(" ") .split(" ") .map(function(it,n) { return it.match(/^\d/) ? (it_256).toString(36) : it }).join(" ").replace(/ '([^a-z ]_)' /g, function(all,m) { return m.toUpperCase() }); [outp, inp == outp]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment