Skip to content

Instantly share code, notes, and snippets.

Avatar

Derick Rethans derickr

View GitHub Profile
View gist:296a8f154d93cdf09146
<?php
$c = (new MongoClient())->demo->points;
$c->find( [
'loc' => [
'$geoWithin' => [
'$geometry' => [
'type' => 'Polygon',
'coordinates' => [ [
[ -0.91, 51.74 ],
View gist:c99f833b919fb2028cdc
<?php
$c = (new MongoClient())->demo->points;
$c->find( [
'loc' => [
'$geoWithin' => [
'$geometry' => [
'type' => 'Polygon',
'coordinates' => [ [
[ -0.91, 51.74 ],
@derickr
derickr / nato
Created Nov 26, 2013 — forked from chx/nato
View nato
#!/bin/bash
declare -A nato
nato[A]=Alpha
nato[B]=Bravo
nato[C]=Charlie
nato[D]=Delta
nato[E]=Echo
nato[F]=Foxtrot
nato[G]=Golf
nato[H]=Hotel
View classifier.php
<?php
error_reporting(E_ALL);
define('NUM_FEATURES', 3);
// My dataset describes cities around the world where I might consider living.
// Each sample (city) consists of 3 features:
// * Feature 1: average low winter temperature in the city
// * Feature 2: city population, in millions
View gist:4202205
db.logs.aggregate({ $match : { method : "POST" }, $group : { _id : "$method" }})
@derickr
derickr / leaflet-side-by-side.html
Created Sep 5, 2011 — forked from andrewharvey/leaflet-side-by-side.html
Demo web app displaying two web maps side by side in sync with each other based on Leaflet
View leaflet-side-by-side.html
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
This file is licenced CC0 http://creativecommons.org/publicdomain/zero/1.0/
-->
<head>
<title>Leaflet Maps Side by Side</title>
<link rel="stylesheet" href="/javascript/leaflet/leaflet.css" type="text/css" />
<!--[if lte IE 8]><link rel="stylesheet" href="/javascript/leaflet/leaflet.ie.css" /><![endif]-->
<style type="text/css">
body {