<commit_before>import React from 'react'
import ReactDOM from 'react-dom'
import { clockTick } from './actions/clock'
import * as playerActions from './actions/player'
import * as metadataActions from './actions/metadata'
import { bindActionCreators } from 'redux'
import Player from './lib/Player'

export default function client(store, view) {
  if (process.env.NODE_ENV !== 'production') {
    // we have to init this here manually (rather than the convenience of
    // webpack-dev-server --inline) because the hot reloading includes conflict
    // with the static page build (document not defined).
    require('webpack-dev-server/client?http://0.0.0.0:8080')
    require('webpack/hot/dev-server')
  }

  const ui = ReactDOM.render(view, document.getElementById('app'))

  const player = new Player()
  let lastPlayerState
  function updatePlayer() {
    const newState = store.getState().player
    if (newState !== lastPlayerState) {
      player.update(newState)
      lastPlayerState = newState
    }
  }
  store.subscribe(updatePlayer)
  updatePlayer()

  setInterval(() => store.dispatch(clockTick(performance.now())), 1000 / 20)

  window.hacktunes = {
    store,
    ui,
    player,
    metadataActions: bindActionCreators(playerActions, store.dispatch),
    playerActions: bindActionCreators(metadataActions, store.dispatch),
  }
}<commit_msg>Rename debug global<commit_after>import React from 'react'
import ReactDOM from 'react-dom'
import { clockTick } from './actions/clock'
import * as playerActions from './actions/player'
import * as metadataActions from './actions/metadata'
import { bindActionCreators } from 'redux'
import Player from './lib/Player'

export default function client(store, view) {
  if (process.env.NODE_ENV !== 'production') {
    // we have to init this here manually (rather than the convenience of
    // webpack-dev-server --inline) because the hot reloading includes conflict
    // with the static page build (document not defined).
    require('webpack-dev-server/client?http://0.0.0.0:8080')
    require('webpack/hot/dev-server')
  }

  const ui = ReactDOM.render(view, document.getElementById('app'))

  const player = new Player()
  let lastPlayerState
  function updatePlayer() {
    const newState = store.getState().player
    if (newState !== lastPlayerState) {
      player.update(newState)
      lastPlayerState = newState
    }
  }
  store.subscribe(updatePlayer)
  updatePlayer()

  setInterval(() => store.dispatch(clockTick(performance.now())), 1000 / 20)

  window.H = {
    store,
    ui,
    player,
    metadataActions: bindActionCreators(playerActions, store.dispatch),
    playerActions: bindActionCreators(metadataActions, store.dispatch),
  }
}
{'fraction_non_alphanumeric': 0.11938098747236552, 'fraction_numerical': 0.010316875460574797, 'mean_word_length': 3.927404718693285, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '7436471', 'n_tokens_mistral': 791, 'n_tokens_neox': 759, 'n_words': 212}