Skip to content

Instantly share code, notes, and snippets.

View tapanpandita's full-sized avatar

Tapan Pandita tapanpandita

  • Monzo
  • London, England
View GitHub Profile
import hypertrack
from django.utils import timezone
# Set your API key on the [library](https://github.com/hypertrack/hypertrack-python)
hypertrack.secret_key = '<YOUR_SECRET_KEY>'
# Create a [cluster/fleet](http://docs.hypertrack.io/docs/fleets#create-a-fleet) to add drivers to
fleet = hypertrack.Fleet.create(name="South Delhi")
import hypertrack
hypertrack.secret_key = 'sk_fewbyitestvnl2122032'
data = {'name': name, 'vehicle_type': 'car', 'phone': '+16502469293', 'fleet_id': fleet_id, 'photo': open('/tmp/15.jpg')}
driver = hypertrack.Driver.create(**data)
customer = hypertrack.Customer.create(name='John Doe')
destination = hypertrack.Destination.create(customer_id=customer.id, address='Union Square',
{
"results":[
{
"name":{
"title":"mrs",
"first":"shannon",
"last":"soto"
},
"picture":{
"large":"https://randomuser.me/api/portraits/women/42.jpg",
var hypertrack = require('hypertrack')('<SECRET_KEY>');
// Create a new customer and then a new destination for that customer:
hypertrack.customers.create({
name: 'Tapan Pandita',
email: 'support@hypertrack.io'
}).then(function(customer) {
return hypertrack.destination.create({
customer_id: customer.id,
address: '270 Linden Street',
import hypertrack
hypertrack.secret_key = '<SECRET_KEY>'
# Create a Customer
customer = hypertrack.Customer.create(
name='John Doe',
email='john@customer.com',
phone='+15555555555',
)
package io.hypertrack.examples;
import io.hypertrack.factory.CustomerFactory;
import io.hypertrack.factory.DestinationFactory;
import io.hypertrack.model.Customer;
import io.hypertrack.model.Destination;
import io.hypertrack.net.HyperTrackClient;
import java.util.*;
HTDriver driver = new HTDriver()
.setName("Tapan Pandita")
.setPhone("+15555555555")
.setVehicleType(HTDriverVehicleType.CAR);
HTDestination destination = new HTPlace()
.setAddress("Union Square, San Francisco");
HTLiteParamsBuilder htLiteParamsBuilder = new HTLiteParamsBuilder();
HTLiteParams htLiteParams = htLiteParamsBuilder.setDriver(driver)

Keybase proof

I hereby claim:

  • I am tapanpandita on github.
  • I am tapan (https://keybase.io/tapan) on keybase.
  • I have a public key whose fingerprint is 6BAF AEDD AD85 EFDF 0F58 123C AC65 534C ECF9 8CB9

To claim this, I am signing this object:

@tapanpandita
tapanpandita / .gitignore
Created May 11, 2012 12:11
Serving password protected files from Nginx
.*.swp
@tapanpandita
tapanpandita / django_task_queue.md
Created May 6, 2012 16:54
Task queuing in Django with ZeroMQ

Task queuing in Django with ZeroMQ

Introduction

Here at Glitterbug Tech, Django is the lifeline of everything we make and we are big fans! Django doesn't get in the way and lets us write the language we love, python, while providing an amazing set of tools that makes creating web applications fast and fun. But, as you know, code is executed synchronously before you can send back a response. Which means when you are generating that report from your database which has a million rows, your client has to wait for a response while your application huffs and puffs trying to get everything ready (Unless he times out, in which case you receive angry calls while you try to explain what "502 Bad Gateway" means). Sometimes you just want to make your site more responsive by pushing time consuming tasks in the background ("Your comment has been posted!" while a zmq process works in the backend adding it to your db/caching layer/pushing it to followers/creating rainbows). Wha