Skip to content

Instantly share code, notes, and snippets.

View samkit5495's full-sized avatar

Samkit Jain samkit5495

View GitHub Profile
@samkit5495
samkit5495 / createContact.py
Last active March 15, 2024 14:37
Code to create a contact using Google's People API
from __future__ import print_function
import httplib2
import os
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
@samkit5495
samkit5495 / supportTags.py
Created June 15, 2017 19:10
Add attributes to django forms with templatetags
from django import template
register = template.Library()
@register.filter(name='addattr')
def addattr(field, attr):
attrs={}
attr_list = [i.strip() for i in attr.split('|')]
for i in attr_list:
attribute = [j.strip() for j in i.split(':')]