Skip to content

Instantly share code, notes, and snippets.

Zlatko Mašek zmasek

Block or report user

Report or block zmasek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@moshmage
moshmage / withinRadius.js
Last active Jul 5, 2019
compares two objects lat/lon and returns true if within provided kms
View withinRadius.js
/**
* is One Point within Another
* @param point {Object} {latitude: Number, longitude: Number}
* @param interest {Object} {latitude: Number, longitude: Number}
* @param kms {Number}
* @returns {boolean}
*/
function withinRadius(point, interest, kms) {
'use strict';
@dhendo
dhendo / gist:4277592
Created Dec 13, 2012
Mongo Model Serializer for django-rest-framework
View gist:4277592
import mongoengine
class MongoModelSerializer(serializers.ModelSerializer):
def get_default_fields(self):
cls = self.opts.model
opts = get_concrete_model(cls)
#pk_field = opts.pk
fields = []
fields += [getattr(opts, field) for field in opts._fields]
#fields += [field for field in opts.many_to_many if field.serialize]
@quiver
quiver / README.md
Last active Nov 9, 2019
Who says PostgreSQL can't Pub/Sub like Redis?
View README.md

Pub/Sub pattern with PostgreSQL's LISTEN/NOTIFY command

This is a simple chat-like program using pub-sub pattern, backed by PostgreSQL's LISTEN/NOTIFY command.

Publish

publish message to foo channel from user nickname.

$ python pub.py foo nickname
PUBLISH to channel #foo
You can’t perform that action at this time.