Skip to content

Instantly share code, notes, and snippets.

View gfiorav's full-sized avatar

Guido Fioravantti gfiorav

View GitHub Profile
curl -s https://gist.githubusercontent.com/gfiorav/f90fe99cc8c6546a38af6474b9c77224/raw/d1517aace1f1ad9796b0a615d538b96d1c5701e6/unicorn.config.rb > /bb/datavis/cartodb/embedded/cartodb/config/unicorn.conf.rb
#!/bin/sh
cd /bb/datavis/cartodb/embedded/cartodb
git remote add cartodb-org https://github.com/cartodb-org/cartodb.git
git fetch cartodb-org
git checkout $1
cd lib/assets/javascripts/cdb
git remote add cartodb-org https://github.com/cartodb-org/cartodb.js.git
git fetch cartodb-org
@gfiorav
gfiorav / cartodb_table_management.md
Last active April 13, 2016 13:26
How the CartoDB Editor keeps track of tables

Keeping editor tables accurate

In recent weeks I've been tasked with tracking down some issues in CartoDB related to some duplicate tables appearing in some users' dashboards. It was a race condition in a process we call "ghost table linkage", that helps the editor keep up with changes in the user's db.

The issue was fixed implementing a redis lock following the RedLock alghorithm. You can find our implementation (the horrendously named Carto::Bolt) here.

I decided to keep on and try to refactor the whole user db-editor sync a bit. That's what this piece is about: How the CartoDB editor tracks physical table changes in the user's database.

Some background

@gfiorav
gfiorav / euma_python_example.md
Last active January 5, 2016 14:28
Enterprise Users Management API example

Importing users into a CartoDB Organization from a CSV or JSON file

This is an example of how a program can use the Enterprise Users Management API to create, update or delete users from a CSV or a JSON file.

We use two python files: secrets.py containing the owners credentials (name, API key and org name) and manage_users.py with the code to be run.

# manage_users.py
# encoding: utf-8

Quick start


This API allows organization owners to add users to, delete users from or modify users in their organization.

The endpoint is <org>.cartodb.com/u/<org_owner>/api/v1/organization/<org>/users.

Create a user

The parameters sent (via POST; * means they're compulsory) are:

  • username (*) - username for the new user