Skip to content

Instantly share code, notes, and snippets.

View geoffreyp's full-sized avatar

Geoffrey Pruvost geoffreyp

View GitHub Profile
@yang-g
yang-g / greeter_async_server.cc
Created March 17, 2017 22:26
grpc async server toy example
// Class encompasing the state and logic needed to serve a request.
class CallDataBase {
public:
// Take in the "service" instance (in this case representing an asynchronous
// server) and the completion queue "cq" used for asynchronous communication
// with the gRPC runtime.
CallDataBase(Greeter::AsyncService* service, ServerCompletionQueue* cq)
: service_(service), cq_(cq), status_(PROCESS) {}
virtual ~CallDataBase() {}
@ismaels
ismaels / polyline_decoder.js
Created September 20, 2013 12:50
Javascript function to decode google maps api polyline
// source: http://doublespringlabs.blogspot.com.br/2012/11/decoding-polylines-from-google-maps.html
function decode(encoded){
// array that holds the points
var points=[ ]
var index = 0, len = encoded.length;
var lat = 0, lng = 0;
while (index < len) {
var b, shift = 0, result = 0;