Skip to content

Instantly share code, notes, and snippets.

@zanemcca
zanemcca / generateBox.js
Last active September 14, 2022 10:49
Converts a box into a $geometry 'Polygon' type for approximate flat $box queries on MongoDB 2DSphere indices.
const LAT = 1;
const LNG = 0;
const PRECISION = 1.0; //In degrees latitude
/*
* generateBoxGeometry will generate a `Polygon` type bounding geometry for use on 2DSphere indices
* that approximates a flat $box query. It takes in the south-west and north-east corner of the box.
*/
@zanemcca
zanemcca / vimrc
Created November 27, 2015 01:03
Pimped out vimrc file for the people
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@zanemcca
zanemcca / Results
Last active November 16, 2015 18:43
Tests docker v1.9.1 to see if a broken symlink disrupts the COPY and ADD cache invalidation
Testing Broken Symlink Issue
Client:
Version: 1.9.1-rc1
API version: 1.21
Go version: go1.4.2
Git commit: aba5981
Built: Fri Nov 13 09:46:58 UTC 2015
OS/Arch: linux/amd64
Server: