Skip to content

Instantly share code, notes, and snippets.

View jakepruitt's full-sized avatar

Jake Pruitt jakepruitt

View GitHub Profile
1) mapnik.VectorTile.composite should support compositing tiles and clipping to max_extent (reencode):
AssertionError: 54521 == 54462
+ expected - actual
-54521
+54462
at Context.<anonymous> (test/vector-tile.composite.test.js:304:16)
cd ../mapnik
make clean
git pull
git submodule update --init
source ./bootstrap.sh
./configure
make # takes a very long time
make install
cd ../mapnik-vector-tile
#include <mapnik/util/file_io.hpp>
#include "vector_tile.pb.h"
#include "vector_tile_compression.hpp"
#include <iostream>
#include <fstream>
#include <protozero/pbf_reader.hpp>
int main(int argc, char** argv)
@jakepruitt
jakepruitt / server.js
Created January 15, 2015 05:42
seneca-hapi API example
var Hapi = require('hapi');
var seneca = require('seneca')();
var server = new Hapi.Server();
seneca.add({role: 'test', cmd: 'test'}, function(args, done) {
console.log('Recieved a request');
done(null, {worked: true});
});
seneca.use('./seneca-hapi.js');
@jakepruitt
jakepruitt / server.js
Last active August 29, 2015 14:11 — forked from gergelyke/server.js
var fetch = function (username, next) {
// get tweets from the twitter API
next(null, tweets);
};
server.method({
name: 'twitter.fetch',
method: fetch
});
@jakepruitt
jakepruitt / Gruntfile.js
Created October 1, 2014 04:35
Splitting grunt tasks
module.exports = function (grunt) {
// Load the project's grunt tasks from a directory
require('grunt-config-dir')(grunt, {
configDir: require('path').resolve('tasks')
});
// Register group tasks
grunt.registerTask('build', [ 'jshint', 'stylus', 'browserify', 'i18n', 'copyto' ]);
grunt.registerTask('test', [ 'jshint', 'mochacli' ]);
@jakepruitt
jakepruitt / css_resources.md
Created August 28, 2014 16:40 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@jakepruitt
jakepruitt / javascript_resources.md
Created August 28, 2014 16:40 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@jakepruitt
jakepruitt / 0_reuse_code.js
Created August 28, 2014 16:39
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jakepruitt
jakepruitt / jquery.deepextend.js
Last active August 29, 2015 14:05
Quick comparison of deep-extend implementations
jQuery.extend = jQuery.fn.extend = function() {
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;