Skip to content

Instantly share code, notes, and snippets.

@eligrey
Forked from jed/LICENSE.txt
Last active April 24, 2018 00:32

Revisions

  1. eligrey revised this gist Mar 4, 2013. 2 changed files with 2 additions and 6 deletions.
    6 changes: 1 addition & 5 deletions annotated.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1 @@
    function( // return a function
    c // that takes some text
    ){
    return new Option(c).innerHTML;
    }
    new Option(c).innerHTML
    2 changes: 1 addition & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    function(c){return new Option(c).innerHTML}
    new Option(c).innerHTML
  2. eligrey revised this gist Feb 3, 2012. 2 changed files with 6 additions and 9 deletions.
    13 changes: 5 additions & 8 deletions annotated.js
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,5 @@
    function()
    {
    return function( // return a function
    c // that takes some text
    ){
    return new Option(c).innerHTML;
    }
    }()
    function( // return a function
    c // that takes some text
    ){
    return new Option(c).innerHTML;
    }
    2 changes: 1 addition & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    function(){return function(c){return new Option(c).innerHTML}}()
    function(c){return new Option(c).innerHTML}
  3. eligrey revised this gist Sep 17, 2011. 4 changed files with 6 additions and 28 deletions.
    1 change: 1 addition & 0 deletions LICENSE.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    Public domain. NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
    13 changes: 0 additions & 13 deletions LICENSE.txt
    Original file line number Diff line number Diff line change
    @@ -1,13 +0,0 @@
    DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
    Version 2, December 2004

    Copyright (C) 2011 Jed Schmidt <http://jed.is>

    Everyone is permitted to copy and distribute verbatim or modified
    copies of this license document, and changing it is allowed as long
    as the name is changed.

    DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

    0. You just DO WHAT THE FUCK YOU WANT TO.
    18 changes: 4 additions & 14 deletions annotated.js
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,8 @@
    function(
    a, // the document
    b // placeholder
    ){
    a = ( // cache
    b = // both
    a.createElement("b") // a created element,
    ).appendChild( // and its appended
    a.createTextNode(0) // child text node, and
    );

    function()
    {
    return function( // return a function
    c // that takes some text
    ){
    a.nodeValue = c; // writes it to the text node
    return b.innerHTML // and then reads its escaped html
    return new Option(c).innerHTML;
    }
    }(document) // auto-run to cache nodes
    }()
    2 changes: 1 addition & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    function(a,b){a=(b=a.createElement("b")).appendChild(a.createTextNode(0));return function(c){a.nodeValue=c;return b.innerHTML}}(document)
    function(){return function(c){return new Option(c).innerHTML}}()
  4. @jed jed revised this gist May 31, 2011. 1 changed file with 13 additions and 20 deletions.
    33 changes: 13 additions & 20 deletions LICENSE.txt
    Original file line number Diff line number Diff line change
    @@ -1,20 +1,13 @@
    Copyright (c) 2011 Jed Schmidt, http://jed.is

    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:

    The above copyright notice and this permission notice shall be
    included in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
    LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
    OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
    WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
    Version 2, December 2004

    Copyright (C) 2011 Jed Schmidt <http://jed.is>

    Everyone is permitted to copy and distribute verbatim or modified
    copies of this license document, and changing it is allowed as long
    as the name is changed.

    DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

    0. You just DO WHAT THE FUCK YOU WANT TO.
  5. @jed jed revised this gist May 22, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion annotated.js
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ function(
    b // placeholder
    ){
    a = ( // cache
    ( b = // both
    b = // both
    a.createElement("b") // a created element,
    ).appendChild( // and its appended
    a.createTextNode(0) // child text node, and
  6. @jed jed revised this gist May 22, 2011. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions annotated.js
    Original file line number Diff line number Diff line change
    @@ -10,9 +10,9 @@ function(
    );

    return function( // return a function
    d // that takes some text
    c // that takes some text
    ){
    c.nodeValue = d; // writes it to the text node
    a.nodeValue = c; // writes it to the text node
    return b.innerHTML // and then reads its escaped html
    }
    }(document) // auto-run to cache nodes
  7. @jed jed revised this gist May 22, 2011. 2 changed files with 7 additions and 6 deletions.
    11 changes: 6 additions & 5 deletions annotated.js
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,12 @@
    function(
    a, // the document
    b, // placeholder for the parent node
    c // placeholder for the text node
    b // placeholder
    ){
    b = a.createElement("b"); // create the parent node
    c = b.appendChild( // and append
    a.createTextNode() // a child text node
    a = ( // cache
    ( b = // both
    a.createElement("b") // a created element,
    ).appendChild( // and its appended
    a.createTextNode(0) // child text node, and
    );

    return function( // return a function
    2 changes: 1 addition & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    function(a,b,c){b=a.createElement("b");c=b.appendChild(a.createTextNode(""));return function(d){c.nodeValue=d;return b.innerHTML}}(document)
    function(a,b){a=(b=a.createElement("b")).appendChild(a.createTextNode(0));return function(c){a.nodeValue=c;return b.innerHTML}}(document)
  8. @jed jed revised this gist May 22, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    function(a,b,c){b=a.createElement("b");c=b.appendChild(a.createTextNode());return function(d){c.nodeValue=d;return b.innerHTML}}(document)
    function(a,b,c){b=a.createElement("b");c=b.appendChild(a.createTextNode(""));return function(d){c.nodeValue=d;return b.innerHTML}}(document)
  9. @jed jed revised this gist May 15, 2011. 3 changed files with 38 additions and 1 deletion.
    20 changes: 20 additions & 0 deletions LICENSE.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    Copyright (c) 2011 Jed Schmidt, http://jed.is

    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:

    The above copyright notice and this permission notice shall be
    included in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
    LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
    OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
    WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    17 changes: 17 additions & 0 deletions annotated.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    function(
    a, // the document
    b, // placeholder for the parent node
    c // placeholder for the text node
    ){
    b = a.createElement("b"); // create the parent node
    c = b.appendChild( // and append
    a.createTextNode() // a child text node
    );

    return function( // return a function
    d // that takes some text
    ){
    c.nodeValue = d; // writes it to the text node
    return b.innerHTML // and then reads its escaped html
    }
    }(document) // auto-run to cache nodes
    2 changes: 1 addition & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    function(d,b,t){b=d.createElement("b");t=b.appendChild(d.createTextNode());return function(s){t.nodeValue=s;return b.innerHTML}}(document)
    function(a,b,c){b=a.createElement("b");c=b.appendChild(a.createTextNode());return function(d){c.nodeValue=d;return b.innerHTML}}(document)
  10. @jed jed revised this gist May 13, 2011. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    {
    "name": "escapeHTML",
    "keywords": ["escape", "escaping", "HTML", "XSS"]
    }
  11. @jed jed revised this gist May 10, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    function(){/******************************************************************************************************************************/}
    function(d,b,t){b=d.createElement("b");t=b.appendChild(d.createTextNode());return function(s){t.nodeValue=s;return b.innerHTML}}(document)
  12. 140bytesbot created this gist May 9, 2011.
    1 change: 1 addition & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    function(){/******************************************************************************************************************************/}