Skip to content

Instantly share code, notes, and snippets.

@lxbarth
lxbarth / gist:1474055
Created December 13, 2011 21:53
Better reporting in TileMill, first steps
diff --git a/commands/export.bones b/commands/export.bones
index 2c7dd98..a8d3ac8 100644
--- a/commands/export.bones
+++ b/commands/export.bones
@@ -158,7 +158,6 @@ command.prototype.error = function(err) {
error: err.toString(),
updated: +new Date()
});
- console.error(err.toString());
};
@lxbarth
lxbarth / better_cli.patch
Created December 13, 2011 22:22
Better reporting to CLI for TileMill
diff --git a/commands/export.bones b/commands/export.bones
index 2c7dd98..e3b5286 100644
--- a/commands/export.bones
+++ b/commands/export.bones
@@ -126,7 +126,9 @@ command.prototype.initialize = function(plugin, callback) {
if (err) throw err;
model.localize(model.toJSON(), this);
}, function(err) {
- if (err) return cmd.error(err);
+ if (err) return cmd.error(err, function() {
mapbox@mapbox2:~/tilemill$ git diff
diff --git a/commands/export.bones b/commands/export.bones
index e3b5286..c71dad6 100644
--- a/commands/export.bones
+++ b/commands/export.bones
@@ -328,9 +328,12 @@ command.prototype.upload = function (callback) {
}, this);
}, function(err, resp, body) {
if (err) throw err;
- if (resp.statusCode !== 200)
Notice: spawning nice -n19 /Users/ab/.nvm/v0.4.12/bin/node /Users/ab/apps/tilemill/index.js export election-cd-1990-cd /Users/ab/apps/atlas-project/tilemill/export/election-cd-1990-cd.mbtiles --format=mbtiles --bbox=-180,18.1459,-66.4233,72.0197 --minzoom=3 --maxzoom=9 --files=/Users/ab/apps/atlas-project/tilemill/
{ stack: [Getter/Setter],
arguments: undefined,
type: undefined,
message: 'Sqlite Plugin: /Users/ab/apps/atlas-project/spatial-data/cd1990.sqlite does not exist (encountered during parsing of layer \'elections\' in map \'/Users/ab/apps/atlas-project/tilemill/project/election-cd-1990-cd/\')' }
{ stack: [Getter/Setter],
arguments: undefined,
type: undefined,
message: 'Sqlite Plugin: /Users/ab/apps/atlas-project/spatial-data/cd1990.sqlite does not exist (encountered during parsing of layer \'elections\' in map \'/Users/ab/apps/atlas-project/tilemill/project/election-cd-1990-cd/\')' }
nice -n19 /Users/ab/.nvm/v0.4.12/bin/node /Users/ab/apps/tilemill/index.js export election-cd-1990-cd /Users/ab/apps/atlas-project/tilemill/export/election-cd-1990-cd.mbtiles --format=mbtiles --bbox=-180,18.1459,-66.4233,72.0197 --minzoom=3 --maxzoom=9 --files=/Users/ab/apps/atlas-project/tilemill/
{"filename":"election-cd-1990-cd_557b39.mbtiles","status":"processing"}
{ stack: [Getter/Setter],
arguments: undefined,
type: undefined,
message: 'Sqlite Plugin: /Users/ab/apps/atlas-project/spatial-data/cd1990.sqlite does not exist (encountered during parsing of layer \'elections\' in map \'/Users/ab/apps/atlas-project/tilemill/project/election-cd-1990-cd/\')' }
{ stack: [Getter/Setter],
arguments: undefined,
type: undefined,
message: 'Sqlite Plugin: /Users/ab/apps/atlas-project/spatial-data/cd1990.sqlite does not exist (encountered during parsing of layer \'elections\' in map \'/Users/ab/apps/atlas-project/tilemill/project/election-cd-1990-cd/\')' }
var _ = require('underscore');
var layers = [
'one',
'two',
'three'
];
console.error(layers);
layers = _.without(layers, 'one');

Click 'Add to home screen' in Web browser:

You'll find a new icon on your Home Screen now:

It will open your site in fullscreen:

First Ever Comprehensive Afghan Media Survey Visualized

Using Data to Inform on the Ground Decisions in Afghanistan

We just finished working with Internews to map the first ever comprehensive media survey in Afghanistan. By processing 6,648 close-ended interviews across 107 districts in all 34 provinces, we have created an extensive visualization of the Afghan media landscape. Check out the full site.

Proper media access creates opportunity for social change by connecting people and providing uncensored news. Nothing proves this better than the internet's key role in the recent events of the Arab Spring. As a non-profit organization working in Afghanistan, Internews understands the importance of media access in the difficult path towards peace and prosperity. Internews has recognized that their work supporting local media initiatives must be informed by hard data about the evolving needs of Afghanistan's population. Therefore,

@lxbarth
lxbarth / ed-about.md
Created January 20, 2012 16:53 — forked from ian29/ed-about.md

About this map

School Performance in America

This map contains the latest available data on graduation rates, math and reading performance for the time between 2007 and 2010. This is data that has been published by the Department of Education continuously since [YEAR], for the first time it is made available through an easy to explore interface and as download in an open format.

Sharing the map

At any time, you can grab a snippet of the map and embed it in another web site - just like a YouTube video. The embed will maintain the exact location you have navigated to.

var path = require('path'),
fs = require('fs');
Bones.Command.options['files'] = {
'title': 'files=[path]',
'description': 'Path to files directory.',
'default': function(options, config) {
return path.join(process.cwd(), 'files');
}