Skip to content

Instantly share code, notes, and snippets.

Avatar

Calvin Metcalf calvinmetcalf

View GitHub Profile
View exports.js
//we will use this again
function foo(){
function bar(){
}
return bar;
}
//export by itself
//with a declaration
View simplesytle.js
var options = {
style:function(feature){
if(!feature.properties){
return;
}
var out = {};
if(feature.properties.stroke){
out.color = feature.properties.stroke;
}
if(feature.properties["fill-opacty"]){
View test.js
var scheme = new PyramidScheme({
minzoom: 0,
maxzoom: 2,
concurrency: 1,
metatile: 1
});
var tiles = [];
scheme.task = {
View highland.v2.js
'use strict';
var inherits = require('util').inherits;
var Transform = require('readable-stream').Transform;
module.exports = Stream;
inherits(Stream, Transform);
//can take either 1 or 2 functions or an array
View pouchdb.js
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.PouchDB=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
"use strict";
var utils = _dereq_('./utils');
var merge = _dereq_('./merge');
var errors = _dereq_('./deps/errors');
var EventEmitter = _dereq_('events').EventEmitter;
/*
* A generic pouch adapter
*/
View cob.topojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View cob.topojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View walksheds.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View walksheds.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View blog.md

NPM as a build system

The reasons that you often don't need grunt have been [done][love-unix] [to death][two], so I don't feel any need to lend my voice except to agree. I've also seen Make thrown around as another alternative. Make is a fine program on *nix systems but for node.js it's missing a copule things,

  1. it is global, you have to specify ./node_modules/uglify-js/bin/uglifyjs instead of just uglifyjs.
  2. it is a pain to use on windows.

Now before we turn this into a windows/*nix flame war let me point out, I do not develop on windows, I despise developing on windows, the only time I ever voluntarily touch windows machines is when I'm helping my fiance fix her laptop. But that being said I work with people who use windows and I'd like to continue working with them as I have no interest in doing the heroic work they do with our legacy .NET apps.