<commit_before><html>
<head>
<script src="https://www.gstatic.com/firebasejs/3.9.0/firebase-app.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="https://www.gstatic.com/firebasejs/3.1.0/firebase-database.js"></script>
<script>
  // Initialize Firebase
  var config = {
    apiKey: "<KEY>",
    authDomain: "srijantextbox.firebaseapp.com",
    databaseURL: "https://srijantextbox.firebaseio.com",
    projectId: "srijantextbox",
    storageBucket: "srijantextbox.appspot.com",
    messagingSenderId: "523068385597"
  };
  firebase.initializeApp(config);
  var database = firebase.database().ref();
  var textboxRef = database.child('textbox'); //Get a reference to the "textbox" child
  var $textbox = $('#textbox'); //Saves a referenve to the textarea element using jQuery

  textboxRef.on('value', function(snapshot) {
    console.log("From Firebase:", snapshot.val());
    $textbox.val(snapshot.val().text);
  });

  $textbox.keyup(function() {
    textboxRef.set({
      text: $textbox.val()
    });
  });
</script>

<link rel="stylesheet" href="style.css">
</head>
<textarea name="textbox" id="textbox" placeholder="Type here"></textarea>

</html><commit_msg>Fixing problems with Firebase realtime database<commit_after><html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="https://www.gstatic.com/firebasejs/3.9.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/3.9.0/firebase-database.js"></script>
<script src="https://www.gstatic.com/firebasejs/3.9.0/firebase.js"></script>

<script>
  // Initialize Firebase
  var config = {
    apiKey: "<KEY>",
    authDomain: "srijantextbox.firebaseapp.com",
    databaseURL: "https://srijantextbox.firebaseio.com",
    projectId: "srijantextbox",
    storageBucket: "srijantextbox.appspot.com",
    messagingSenderId: "523068385597"
  };
  firebase.initializeApp(config);
</script>
<script>

var database = firebase.database();//get a reference to firebase database service
var myDataref = database.ref();
var textboxRef = myDataref.child('textbox'); //Get a reference to the "textbox" child
var $textbox = $('#textbox'); //Saves a reference to the textarea element using jQuery

//When anything changes (added, removed, updated) in the "textbox" child in the database
textboxRef.on('value', function(snapshot) {
  console.log("From Firebase:", snapshot.val());
  $textbox.val(snapshot.val().text); //Set the value of the textarea to the value returned by Firebase (specifically the "text" property of the "textbox" child)
});

//When any key is released while the textarea is in focus
$textbox.keyup(function() {
  //Updates the properties and values in the database child called "textbox" with the object provided. The "set" function is used instead of the "update" function so that if the database child "textbox" of its properties are removed, this will create it as well as update it
  textboxRef.update({
    text: $textbox.val()
  });
});
    </script>
    
    

<link rel="stylesheet" href="style.css">
    </head>
<textarea name="textbox" id="textbox" placeholder="Type here"></textarea>


</html>
{'fraction_non_alphanumeric': 0.16017450919289497, 'fraction_numerical': 0.014023060143346837, 'mean_word_length': 4.515463917525773, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 9, 'lorem ipsum': 0, 'www.': 5, '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': '2424610', 'n_tokens_mistral': 1067, 'n_tokens_neox': 1045, 'n_words': 251}