Skip to content

Instantly share code, notes, and snippets.

@davisml
davisml / draftToHTML.js
Last active March 9, 2017 12:47
DraftJS block data to HTML
// AttributedString class from https://github.com/cohitre/attributedString.js
// Modifications made to support html tags & remove span wrapper from unstyled blocks
var AttributedString = (function () {
var aString
, StringRange
, RangesList
, HtmlSerializer
, plainStringSerializer
, _ = {}
, entityMap = {
@jmizgajski
jmizgajski / group_chain.py
Created May 10, 2014 13:28
Chaining two groups of tasks in celery.
#task is a task that is not interested in any results from other tasks
#callback is a task you want to call after each group is finished (ex. log time)
# and has to take a list of results as first arguement
@app.task(base=Task)
def task(i):
#do stuff
pass
@app.task(base=Task)
@jorilallo
jorilallo / gist:3686737
Created September 9, 2012 19:33
Google Contacts API authentication with gdata and OAuth2
import gdata
import json
import requests
# More examples:
# https://github.com/millioner/Python-contact-importer/blob/master/contact_importer/providers/google.py
# https://github.com/jtauber/django-friends/blob/master/friends/importer.py
# GData with access token
token = gdata.gauth.OAuth2Token(