<commit_before>'use strict';

import * as _ from 'lodash'
import * as React from 'react'
React.initializeTouchEvents(true)
import * as Promise from 'bluebird'
Promise.longStackTraces()

import db from './helpers/db.es6'
import documentReady from './helpers/document-ready.es6'

import Gobbldygook from './elements/gobbldygookApp.es6'
import loadData from './helpers/loadData.es6'
import emitter from './helpers/emitter.es6'
import svgSpinner from './svg-spinner.es6'

import 'es6-shim'

// Just for use in the browser console, I swear.
window.lodash = _

// Stick React where I (and the Chrome devtools)
// [ok, mostly for the devtools] can see it.
window.React = React

// Handy debugging function
window.log = (thing) => console.log(_.isUndefined(thing) ? arguments : thing)

let render = () => React.render(React.createElement(Gobbldygook, null), document.body)

let blastoff = () => {
	document.title = 'Gobbldygook Schedule Playground'

	// Wait for document.ready and the database.
	Promise.all([db, documentReady]).then(() => {
		console.log('3. 2.. 1... Blastoff!')

		document.body.innerHTML = '<div class="loading">' + svgSpinner + '</div>'

		// Load data into the database, then render the app
		loadData().then(() => {
			render()
			emitter.on('change', render)
			console.log('done')
		})
	})
}

// run it<commit_msg>Remove uses of `emitter` from App.es6<commit_after>'use strict';

import * as _ from 'lodash'
import * as React from 'react'
React.initializeTouchEvents(true)
import * as Promise from 'bluebird'
Promise.longStackTraces()

import db from './helpers/db.es6'
import documentReady from './helpers/document-ready.es6'

import Gobbldygook from './elements/gobbldygookApp.es6'
import loadData from './helpers/loadData.es6'
import svgSpinner from './svg-spinner.es6'

import 'es6-shim'

// Just for use in the browser console, I swear.
window.lodash = _

// Stick React where I (and the Chrome devtools)
// [ok, mostly for the devtools] can see it.
window.React = React

// Handy debugging function
window.log = (thing) => console.log(_.isUndefined(thing) ? arguments : thing)

let render = () => React.render(React.createElement(Gobbldygook, null), document.body)

let blastoff = () => {
	document.title = 'Gobbldygook Schedule Playground'

	// Wait for document.ready and the database.
	Promise.all([db, documentReady]).then(() => {
		console.log('3. 2.. 1... Blastoff!')

		document.body.innerHTML = '<div class="loading">' + svgSpinner + '</div>'

		// Load data into the database, then render the app
		loadData().then(() => {
			render()
			console.log('done')
		})
	})
}

// run it
{'fraction_non_alphanumeric': 0.14739663093415006, 'fraction_numerical': 0.007656967840735069, 'mean_word_length': 3.9961759082217974, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '1939217', 'n_tokens_mistral': 881, 'n_tokens_neox': 851, 'n_words': 246}