Skip to content

Commit 2dfb5e2

Browse files
authored
Change tabs into spaces (more common in the files)
1 parent 9900873 commit 2dfb5e2

15 files changed

+1406
-1406
lines changed

.jshintrc

+36-36
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
{
2-
"browser":true,
3-
"curly":true,
4-
"eqeqeq":true,
5-
"eqnull":true,
6-
"forin":true,
7-
"freeze":true,
8-
"newcap":false,
9-
"immed":true,
10-
"latedef":true,
11-
"noarg":true,
12-
"noempty":true,
13-
"nonew":true,
14-
"undef":true,
15-
"unused": true,
16-
"smarttabs":false,
17-
"sub":true,
18-
"laxbreak":true,
2+
"browser":true,
3+
"curly":true,
4+
"eqeqeq":true,
5+
"eqnull":true,
6+
"forin":true,
7+
"freeze":true,
8+
"newcap":false,
9+
"immed":true,
10+
"latedef":true,
11+
"noarg":true,
12+
"noempty":true,
13+
"nonew":true,
14+
"undef":true,
15+
"unused": true,
16+
"smarttabs":false,
17+
"sub":true,
18+
"laxbreak":true,
1919
"quotmark":"single",
2020
"nonew": false,
21-
"strict": true,
22-
"globals": {
23-
"define":true,
24-
"require":true,
25-
"$":true,
26-
"_":true,
27-
"console":true,
28-
"path":true,
29-
"alert":true,
30-
"exports":true,
31-
"module":true,
21+
"strict": true,
22+
"globals": {
23+
"define":true,
24+
"require":true,
25+
"$":true,
26+
"_":true,
27+
"console":true,
28+
"path":true,
29+
"alert":true,
30+
"exports":true,
31+
"module":true,
3232
"d3":true,
33-
"L":true,
34-
"moment":true,
35-
"process":true,
36-
"esper": true,
37-
"alfador": true,
38-
"async": true,
39-
"__dirname":true
40-
}
33+
"L":true,
34+
"moment":true,
35+
"process":true,
36+
"esper": true,
37+
"alfador": true,
38+
"async": true,
39+
"__dirname":true
40+
}
4141
}

app.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -57,33 +57,33 @@ app.use('/histogram',histogram);
5757

5858
// catch 404 and forward to error handler
5959
app.use(function(req, res, next) {
60-
var err = new Error('Not Found');
61-
err.status = 404;
62-
next(err);
60+
var err = new Error('Not Found');
61+
err.status = 404;
62+
next(err);
6363
});
6464

6565
// error handlers
6666

6767
// development error handler
6868
// will print stacktrace
6969
if (app.get('env') === 'development') {
70-
app.use(function(err, req, res) {
71-
res.status(err.status || 500);
72-
res.render('error', {
73-
message: err.message,
74-
error: err
70+
app.use(function(err, req, res) {
71+
res.status(err.status || 500);
72+
res.render('error', {
73+
message: err.message,
74+
error: err
75+
});
7576
});
76-
});
7777
}
7878

7979
// production error handler
8080
// no stacktraces leaked to user
8181
app.use(function(err, req, res) {
82-
res.status(err.status || 500);
83-
res.render('error', {
84-
message: err.message,
85-
error: {}
86-
});
82+
res.status(err.status || 500);
83+
res.render('error', {
84+
message: err.message,
85+
error: {}
86+
});
8787
});
8888

8989
module.exports = app;

bin/ingest

+20-20
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,30 @@ var db_init = require('../db/db_init');
2121
var async = require('async');
2222

2323
if (process.argv.length < 3) {
24-
console.log('usage:\n\tnode bin/ingest %DATA_DIRECTORY%');
25-
console.log('\twhere DATA_DIRECTORY% is the absolute path to the directory containing the csv files to import.');
24+
console.log('usage:\n\tnode bin/ingest %DATA_DIRECTORY%');
25+
console.log('\twhere DATA_DIRECTORY% is the absolute path to the directory containing the csv files to import.');
2626
}
2727

2828
var filePath = path.resolve(process.argv[2]);
2929
console.log('Importing from ' + filePath);
3030

3131

3232
async.series([
33-
// initialize the database
34-
function(done) {
35-
db_init.initialize(done);
36-
},
37-
// ingest files
38-
function(done) {
39-
ingestFiles(filePath,done);
40-
}],
41-
// finally
42-
function(err) {
43-
if (err) {
44-
console.trace(err.message);
45-
console.log('IMPORT FAILED');
46-
} else {
47-
console.log('IMPORT COMPLETED SUCCESSFULLY');
48-
}
49-
process.exit(0);
50-
});
33+
// initialize the database
34+
function(done) {
35+
db_init.initialize(done);
36+
},
37+
// ingest files
38+
function(done) {
39+
ingestFiles(filePath,done);
40+
}],
41+
// finally
42+
function(err) {
43+
if (err) {
44+
console.trace(err.message);
45+
console.log('IMPORT FAILED');
46+
} else {
47+
console.log('IMPORT COMPLETED SUCCESSFULLY');
48+
}
49+
process.exit(0);
50+
});

bin/splitworld

+21-21
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,31 @@ var fs = require('fs');
2222
var _ = require('lodash');
2323

2424
var writeCountry = function(iso,countryFeature,subDir) {
25-
var filename = iso + '.geo.json';
26-
var filepath = './data/' + subDir + '/' + filename;
27-
var resolvedPath = path.resolve(filepath);
28-
var json = {
29-
type : 'FeatureCollection',
30-
features : [_.extend(countryFeature,{
31-
id : iso
32-
})]
33-
};
34-
35-
fs.writeFile(resolvedPath,JSON.stringify(json), function(err) {
36-
if(err) {
37-
return console.log(err);
38-
}
39-
40-
console.log(filename + " was sucessfully written");
41-
});
25+
var filename = iso + '.geo.json';
26+
var filepath = './data/' + subDir + '/' + filename;
27+
var resolvedPath = path.resolve(filepath);
28+
var json = {
29+
type : 'FeatureCollection',
30+
features : [_.extend(countryFeature,{
31+
id : iso
32+
})]
33+
};
34+
35+
fs.writeFile(resolvedPath,JSON.stringify(json), function(err) {
36+
if(err) {
37+
return console.log(err);
38+
}
39+
40+
console.log(filename + " was sucessfully written");
41+
});
4242
};
4343

4444
worldHighJSON.features.forEach(function(countryFeature) {
45-
var countryISO_A3 = countryFeature.properties.ISO_A3;
46-
writeCountry(countryISO_A3,countryFeature,'countries_high');
45+
var countryISO_A3 = countryFeature.properties.ISO_A3;
46+
writeCountry(countryISO_A3,countryFeature,'countries_high');
4747
});
4848

4949
worldMedJSON.features.forEach(function(countryFeature) {
50-
var countryISO_A3 = countryFeature.properties.iso_a3;
51-
writeCountry(countryISO_A3,countryFeature,'countries_medium');
50+
var countryISO_A3 = countryFeature.properties.iso_a3;
51+
writeCountry(countryISO_A3,countryFeature,'countries_medium');
5252
});

db/connection.js

+60-60
Original file line numberDiff line numberDiff line change
@@ -17,71 +17,71 @@
1717
(function() {
1818
'use strict';
1919

20-
var mysql = require('mysql');
21-
var config = require('../config');
20+
var mysql = require('mysql');
21+
var config = require('../config');
2222

23-
var pool = mysql.createPool(config.db);
23+
var pool = mysql.createPool(config.db);
2424

25-
var _closeConnection = function(connection) {
26-
connection.release();
27-
};
25+
var _closeConnection = function(connection) {
26+
connection.release();
27+
};
2828

29-
var _openConnection = function(callback) {
30-
pool.getConnection(function(err,connection) {
31-
if (err) {
32-
console.trace(err.message);
33-
if ( callback ) {
34-
callback(err);
35-
}
36-
} else {
37-
connection.query('SET NAMES \'utf8mb4\';', function() {
38-
callback(null,connection);
39-
});
40-
}
41-
});
42-
};
29+
var _openConnection = function(callback) {
30+
pool.getConnection(function(err,connection) {
31+
if (err) {
32+
console.trace(err.message);
33+
if ( callback ) {
34+
callback(err);
35+
}
36+
} else {
37+
connection.query('SET NAMES \'utf8mb4\';', function() {
38+
callback(null,connection);
39+
});
40+
}
41+
});
42+
};
4343

44-
var query = function(sql,values,callback) {
45-
if ( arguments.length === 2 ) {
46-
callback = values;
47-
values = undefined;
48-
}
49-
_openConnection(
50-
function(err,connection) {
51-
if (err) {
52-
if (callback) {
53-
callback(err);
54-
}
55-
} else {
56-
var args = [
57-
sql
58-
];
59-
if (values) {
60-
args.push(values);
61-
}
62-
args.push(function(err,res) {
63-
_closeConnection(connection);
64-
if (err) {
65-
console.trace(err.message);
66-
if (callback) {
67-
callback(err);
68-
}
69-
} else {
70-
if (callback) {
71-
callback(null,res);
72-
}
73-
}
74-
});
75-
connection.query.apply(connection,args);
76-
}
77-
});
78-
};
44+
var query = function(sql,values,callback) {
45+
if ( arguments.length === 2 ) {
46+
callback = values;
47+
values = undefined;
48+
}
49+
_openConnection(
50+
function(err,connection) {
51+
if (err) {
52+
if (callback) {
53+
callback(err);
54+
}
55+
} else {
56+
var args = [
57+
sql
58+
];
59+
if (values) {
60+
args.push(values);
61+
}
62+
args.push(function(err,res) {
63+
_closeConnection(connection);
64+
if (err) {
65+
console.trace(err.message);
66+
if (callback) {
67+
callback(err);
68+
}
69+
} else {
70+
if (callback) {
71+
callback(null,res);
72+
}
73+
}
74+
});
75+
connection.query.apply(connection,args);
76+
}
77+
});
78+
};
7979

80-
var escape = function() {
81-
return pool.escape.apply(pool,arguments);
82-
};
80+
var escape = function() {
81+
return pool.escape.apply(pool,arguments);
82+
};
8383

84-
module.exports.query = query;
85-
module.exports.escape = escape;
84+
module.exports.query = query;
85+
module.exports.escape = escape;
8686

8787
}());

0 commit comments

Comments
 (0)