<commit_before><!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Hello React!</title>
    <script src="node_modules/react/dist/react.js"></script>
    <script src="node_modules/babel-core/browser.min.js"></script>
  </head>
  <body>
    <div id="example"></div>
    <script type="text/babel">
      React.render(
        <h1>Hello, world!</h1>,
        document.getElementById('example')
      );
    </script>
  </body>
</html>
<commit_msg>Basic canvas-based drawing app.<commit_after><!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8" />
  <title>Hello React!</title>
  <!--
  <script src="node_modules/react/dist/react.js"></script>
  <script src="node_modules/babel-core/browser.min.js"></script>
  -->
  <style>
    html, body {
      margin: 0;
      padding: 0;
    }
    body {
      overflow: hidden;
    }
    canvas {
      background-color: transparent;
      cursor: crosshair;
    }
  </style>
</head>
<body>
  <canvas>
  </canvas>
  <script>
    var canvas = document.querySelector('canvas');
    var ctx = canvas.getContext('2d');

    function isTouchDevice() {
      return 'ontouchstart' in window ||
             !!(window.DocumentTouch && document instanceof DocumentTouch);
    }

    function handleResize() {
      canvas.width = window.innerWidth;
      canvas.height = window.innerHeight;
    }

    function handleTouchStart(e) {
      ctx.beginPath();
      ctx.lineCap = 'round';
      ctx.lineWidth = 8;
      ctx.moveTo(e.clientX, e.clientY);
    }

    function handleTouchMove(e) {
      ctx.lineTo(e.clientX, e.clientY);
      ctx.stroke();
    }

    function handleTouchEnd(e) {
      ctx.closePath();
    }

    (function main() {
      window.addEventListener('resize', handleResize);
      handleResize();

      if (isTouchDevice()) {
        canvas.ontouchstart = function(e) {
          if (e.touches.length === 1) {
            handleTouchStart(e.touches[0]);
          }
        };
        canvas.ontouchmove = function(e) {
          if (e.touches.length === 1) {
            handleTouchMove(e.touches[0]);
            e.preventDefault();
          }
        };
        canvas.ontouchend = function(e) {
          handleTouchEnd(e.touches[0]);
        };
      } else {
        var drawing = false;
        canvas.onmousedown = function(e) {
          drawing = true;
          handleTouchStart(e);
        }
        canvas.onmousemove = function(e) {
          if (drawing) {
            handleTouchMove(e);
          }
        }
        canvas.onmouseup = function(e) {
          drawing = false;
          handleTouchEnd(e);
        }
      }
    })();
  </script>
</body>
</html>
{'fraction_non_alphanumeric': 0.1534112325669054, 'fraction_numerical': 0.004900113079532605, 'mean_word_length': 2.0788863109048723, 'pattern_counts': {'":': 0, '<': 44, '<?xml version=': 0, '>': 44, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6087169', 'n_tokens_mistral': 866, 'n_tokens_neox': 850, 'n_words': 145}