PageRenderTime 110ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/lua-minifier/index.html

http://github.com/mathiasbynens/mothereffingcssescapes
HTML | 37 lines | 37 code | 0 blank | 0 comment | 0 complexity | 7ef8efd47d117b335dcf481113f8a3b9 MD5 | raw file
  1. <!DOCTYPE html>
  2. <html lang=en>
  3. <meta charset=utf-8>
  4. <title>Lua minifier</title>
  5. <meta name=viewport content="width=device-width,initial-scale=1">
  6. <link rel=stylesheet href=eff.css>
  7. <meta name=description content="An online, on-the-fly Lua minifier.">
  8. <h1>Lua minifier</h1>
  9. <noscript><strong>To use this tool, please <a href=http://enable-javascript.com/>enable JavaScript</a> and reload the page.</strong></noscript>
  10. <h2>Input</h2>
  11. <textarea autofocus>for z = 1, 10 do
  12. for y = 1, 10 do
  13. for x = 1, 10 do
  14. if x ^ 2 + y ^ 2 == z ^ 2 then
  15. print('found a Pythagorean triple:', x, y, z)
  16. goto done
  17. end
  18. end
  19. end
  20. end
  21. ::done::</textarea>
  22. <h2>Minified result (<a href=#for%20z%20%3D%201%2C%2010%20do%0A%20%20for%20y%20%3D%201%2C%2010%20do%0A%20%20%20%20for%20x%20%3D%201%2C%2010%20do%0A%20%20%20%20%20%20if%20x%20%5E%202%20%2B%20y%20%5E%202%20%3D%3D%20z%20%5E%202%20then%0A%20%20%20%20%20%20%20%20print%28%27found%20a%20Pythagorean%20triple%3A%27%2C%20x%2C%20y%2C%20z%29%0A%20%20%20%20%20%20%20%20goto%20done%0A%20%20%20%20%20%20end%0A%20%20%20%20end%0A%20%20end%0Aend%0A%3A%3Adone%3A%3A id=permalink>permalink</a>)</h2>
  23. <pre><code id=output>for a=1,10 do for b=1,10 do for c=1,10 do if c^2+b^2==a^2 then print('found a Pythagorean triple:',c,b,a)goto d end end end end::d::</code></pre>
  24. <dl>
  25. <dt>Before
  26. <dd>202 bytes
  27. <dt>After
  28. <dd>132 bytes
  29. <dt>Compression ratio
  30. <dd>34.65%
  31. </dl>
  32. <h2>About this tool</h2>
  33. <p>This tool uses <a href=https://mths.be/luamin>luamin</a> to minify any Lua snippet you enter. Under the hood, luamin uses <a href=https://oxyc.github.com/luaparse/>luaparse</a>.
  34. <p id=footer>Made by <a href=https://mathiasbynens.be/>@mathias</a> — <a href=https://github.com/mathiasbynens/mothereff.in/tree/master/lua-minifier>fork this on GitHub!</a></p>
  35. <script src=vendor/luaparse.js></script>
  36. <script src=vendor/luamin.js></script>
  37. <script src=eff.js></script>