<commit_before>var express = require('express');
var app = express();
var http = require('http').Server(app);
var io = require('socket.io')(http);
var path = require('path');

app.use(express.static(__dirname+ '/../client'));

app.get('/', function(request, response){
	response.sendFile(path.resolve(__dirname + '/../client/index.html'));
});

var livingCells = {};
var running = false;

io.on('connection', function(socket){
	console.log('someone connected');
	socket.emit('join', livingCells, running);

	socket.on('stopping', function(){
		running = false;
		io.sockets.emit('stopping');
	});

	socket.on('running', function(){
		running = true;
		io.sockets.emit('running');
	});

	socket.on('clear', function(){
		io.sockets.emit('clear', livingCells);
		livingCells = {};
	})

	socket.on('cell-selected', function(id){
		livingCells['cell' + id] = id; 
		io.sockets.emit('life', id);
	});

	socket.on('cell-deselected', function(id){
		delete livingCells['cell' + id];
		io.sockets.emit('death', id);
	});

	socket.on('disconnect', function(){
		console.log('someone disconnected');
	});
});

http.listen(80);<commit_msg>Added heroku port configuration<commit_after>var express = require('express');
var app = express();
var http = require('http').Server(app);
var io = require('socket.io')(http);
var path = require('path');

var port = process.env.PORT || 5000;

app.use(express.static(__dirname+ '/../client'));

app.get('/', function(request, response){
	response.sendFile(path.resolve(__dirname + '/../client/index.html'));
});

var livingCells = {};
var running = false;

io.on('connection', function(socket){
	console.log('someone connected');
	socket.emit('join', livingCells, running);

	socket.on('stopping', function(){
		running = false;
		io.sockets.emit('stopping');
	});

	socket.on('running', function(){
		running = true;
		io.sockets.emit('running');
	});

	socket.on('clear', function(){
		io.sockets.emit('clear', livingCells);
		livingCells = {};
	})

	socket.on('cell-selected', function(id){
		livingCells['cell' + id] = id; 
		io.sockets.emit('life', id);
	});

	socket.on('cell-deselected', function(id){
		delete livingCells['cell' + id];
		io.sockets.emit('death', id);
	});

	socket.on('disconnect', function(){
		console.log('someone disconnected');
	});
});

http.listen(port);
{'fraction_non_alphanumeric': 0.21607605877268798, 'fraction_numerical': 0.0025929127052722557, 'mean_word_length': 5.173333333333333, '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': '7607920', 'n_tokens_mistral': 817, 'n_tokens_neox': 749, 'n_words': 142}