<commit_before>// main.js
//

(function(w, $, undefined) {
  'use strict';

  // STREAM
  //

	var Stream = {
    config: {

    },
    init: function(elemId) {
      Stream.$elem         = $(elemId);
      Stream.$settingsBtn  = $('#js-stream-settings', Stream.$elem);
      Stream.$loadCta      = $('#js-stream-load', Stream.$elem);
      Stream.$alertCta     = $('#js-stream-alert', Stream.$elem);
      Stream.$daySep       = $('#js-stream-day-sep', Stream.$elem);
      Stream.$streamWindow = $('#js-stream-window', Stream.$elem);

      Stream.state = 'WAITING';

      Stream.bindEvents();
      setTimeout(Stream.startSimulation, 7000);
      console.log(Stream.state);
    },

    bindEvents: function() {
      Stream.$loadCta.on('click', Stream.fetchNewPosts);
      $.subscribe('loadedNewPosts', Stream.onLoadedNewPosts);
    },

    startSimulation: function() {
      Stream.state = 'STARTED';
      Stream.$loadCta.removeClass('stream__load--waiting');
      console.log(Stream.state);<commit_msg>Implement keyboard shortcut to start simulation<commit_after>// main.js
//

(function(w, $, undefined) {
  'use strict';

  // STREAM
  //

	var Stream = {
    config: {

    },
    init: function(elemId) {
      Stream.$elem         = $(elemId);
      Stream.$settingsBtn  = $('#js-stream-settings', Stream.$elem);
      Stream.$loadCta      = $('#js-stream-load', Stream.$elem);
      Stream.$alertCta     = $('#js-stream-alert', Stream.$elem);
      Stream.$daySep       = $('#js-stream-day-sep', Stream.$elem);
      Stream.$streamWindow = $('#js-stream-window', Stream.$elem);

      Stream.state = 'WAITING';

      Stream.bindEvents();
      console.log(Stream.state);
    },

    bindEvents: function() {
      Stream.$loadCta.on('click', Stream.fetchNewPosts);

      // Shortcut keys
      $(document).on('keyup', function(e) {
        switch(e.keyCode) {
          case 83:
            Stream.startSimulation();
            break;
          default:
            console.log(e.keyCode);
        }
      });

      $.subscribe('loadedNewPosts', Stream.onLoadedNewPosts);
    },

    startSimulation: function() {
      Stream.state = 'STARTED';
      Stream.$loadCta.removeClass('stream__load--waiting');
      console.log(Stream.state);
{'fraction_non_alphanumeric': 0.1762621789193977, 'fraction_numerical': 0.002657218777679362, 'mean_word_length': 2.433130699088146, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1953417', 'n_tokens_mistral': 702, 'n_tokens_neox': 677, 'n_words': 107}