Skip to content

Instantly share code, notes, and snippets.

View derickr's full-sized avatar

Derick Rethans derickr

View GitHub Profile
<?php
$c = (new MongoClient())->demo->points;
$c->find( [
'loc' => [
'$geoWithin' => [
'$geometry' => [
'type' => 'Polygon',
'coordinates' => [ [
[ -0.91, 51.74 ],
<?php
$c = (new MongoClient())->demo->points;
$c->find( [
'loc' => [
'$geoWithin' => [
'$geometry' => [
'type' => 'Polygon',
'coordinates' => [ [
[ -0.91, 51.74 ],
@derickr
derickr / gist:1444009
Created December 7, 2011 18:33
Example diff
diff --git a/igbinary.c b/igbinary.c
index d439da7..64a2aa7 100644
--- a/igbinary.c
+++ b/igbinary.c
@@ -918,11 +918,15 @@ inline static int igbinary_serialize_array(struct igbinary_serialize_data *igsd,
switch (key_type) {
case HASH_KEY_IS_LONG:
- igbinary_serialize_long(igsd, key_index TSRMLS_CC);
+ if (igbinary_serialize_long(igsd, key_index TSRMLS_CC)) {
db.logs.aggregate({ $match : { method : "POST" }, $group : { _id : "$method" }})
<?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
@derickr
derickr / nato
Created November 26, 2013 13:29 — forked from chx/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
Verifying that +derickr is my blockchain ID. https://onename.com/derickr
@derickr
derickr / pubs.geojson
Created January 7, 2019 13:38
Pubs in Brent
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am derickr on github.
  • I am derickr (https://keybase.io/derickr) on keybase.
  • I have a public key whose fingerprint is 5A52 8807 81F7 5560 8BF8 15FC 910D EB46 F53E A312

To claim this, I am signing this object:

php-7.4.0alpha1.tar.gz
SHA256 hash:
b199158e0cd2823b4e39379c7f83f41e7e8142b268f48acfc5bb6d48437a1ef1
PGP signature:
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEWlKIB4H3VWCL+BX8kQ3rRvU+oxIFAl0A39sACgkQkQ3rRvU+
oxJVWw/+Nzfw37yTVS5M7LU/tAhvR+8q2vltZK74ZKgvzs+N/pyOm7UIw0ZKwBvP
wLVOBVP/Z+PjP8L4sHuG7oBFDHmV036WaByjPIYxNM3opBGir7Zhcvu4U8yEh50z
sM0tIayGqob+bZapBOmtEe0k4PFtVCNaCKObEUyvdRpOW03HaqlgLzX4HDltjc4G