<commit_before><html>
  <head>
    <script src='https://cdn.firebase.com/v0/firebase.js'></script>
    <script src='https://cdn.firebase.com/js/simple-login/1.3.0/firebase-simple-login.js'></script>
    <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js'></script>
  </head>
  <body>
    <input type='text' id='nameInput' placeholder='Name'>
    <input type='text' id='messageInput' placeholder='Message'>
    <div id="messagesDiv"></div>
    <script type="text/javascript">
      var bomb = new Firebase('https://bomb.firebaseio.com/');
      var messages = bomb.child('messages');
      var users = bomb.child('users');

      $('#messageInput').keypress(function (e) {
        if (e.keyCode == 13) {
          var name = $('#nameInput').val();
          var text = $('#messageInput').val();
          messages.push({name: name, text: text});
          $('#messageInput').val('');
        }
      });

      $('#nameInput').keyup(function(e) {
        nameRef.update({ first : $('#nameInput').val() });
      })

      messages.on('child_added', function(snapshot) {
        var message = snapshot.val();
        displayChatMessage(message.name, message.text);
      });

      function displayChatMessage(name, text) {
        $('<div/>').text(text).prepend($('<em/>').text(name+': ')).appendTo($('#messagesDiv'));
        $('#messagesDiv')[0].scrollTop = $('#messagesDiv')[0].scrollHeight;
      };

      var nameRef;

      var auth = new FirebaseSimpleLogin(bomb, function(error, user) {
        if (error) {
          // an error occurred while attempting login
          console.log(error);
        } else if (user) {
          // user authenticated with Firebase
          // console.log('User ID: ' + user.id + ', Provider: ' + user.provider);
          // $('#nameInput').val(user.id);
          nameRef = users.child(user.id + '/name');
          nameRef.on('value', function(snapshot) {
            $('#nameInput').val(snapshot.val().first);
          });
          // nameRef.child('first').set($('#nameInput').val());
        } else {
          // user is logged out
          auth.login('anonymous', {
            rememberMe: true
          });
        }
      });



    </script>
  </body>
</html>
<commit_msg>Clean up<commit_after><html>
  <head>
    <script src='https://cdn.firebase.com/v0/firebase.js'></script>
    <script src='https://cdn.firebase.com/js/simple-login/1.3.0/firebase-simple-login.js'></script>
    <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js'></script>
  </head>
  <body>
    <input type='text' id='nameInput' placeholder='Name'>
    <input type='text' id='messageInput' placeholder='Message'>
    <div id="messagesDiv"></div>
    <script type="text/javascript">
      var bomb = new Firebase('https://bomb.firebaseio.com/');
      var messages = bomb.child('messages');
      var users = bomb.child('users');

      $('#messageInput').keypress(function (e) {
        if (e.keyCode == 13) {
          var name = $('#nameInput').val();
          var text = $('#messageInput').val();
          messages.push({ name: name, text: text });
          $('#messageInput').val('');
        }
      });

      $('#nameInput').keyup(function(e) {
        nameRef.update({ first : $('#nameInput').val() });
      });

      messages.on('child_added', function(snapshot) {
        var message = snapshot.val();
        displayChatMessage(message.name, message.text);
      });

      function displayChatMessage(name, text) {
        $('<div/>').text(text).prepend($('<em/>').text(name+': ')).appendTo($('#messagesDiv'));
        $('#messagesDiv')[0].scrollTop = $('#messagesDiv')[0].scrollHeight;
      };

      var nameRef;
      var auth = new FirebaseSimpleLogin(bomb, function(error, user) {
        if (error) {
          // an error occurred while attempting login
          console.log(error);
        } else if (user) {
          // user authenticated with Firebase
          nameRef = users.child(user.id + '/name');
          nameRef.on('value', function(snapshot) {
            $('#nameInput').val(snapshot.val().first);
          });
        } else {
          // user is logged out
          auth.login('anonymous', {
            rememberMe: true
          });
        }
      });
    </script>
  </body>
</html>

{'fraction_non_alphanumeric': 0.19735927727588604, 'fraction_numerical': 0.005096131572851517, 'mean_word_length': 2.3946540880503147, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, 'https://': 8, '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': '4244422', 'n_tokens_mistral': 1309, 'n_tokens_neox': 1295, 'n_words': 223}