Skip to content

Instantly share code, notes, and snippets.

View aadidenko's full-sized avatar

Aleksandr Didenko aadidenko

  • Nizhniy Novgorod, Russia
View GitHub Profile
0x38017949acE440BB4740B1819b69A931EeeA88C8
@aadidenko
aadidenko / utils.go
Created January 8, 2016 22:06
parsing time string
func ParseTime(formatted string) (time.Time, error) {
var layouts = [...]string{
"Mon, _2 Jan 2006 15:04:05 MST",
"Mon, _2 Jan 2006 15:04:05 -0700",
time.ANSIC,
time.UnixDate,
time.RubyDate,
time.RFC822,
time.RFC822Z,
time.RFC850,
@aadidenko
aadidenko / gist:3071a8837360bea4ebc9
Last active July 31, 2020 17:21
Get profile image user (Pipeline Python Social Auth) Facebook + Vkontakte
# -*- coding: utf-8 -*-
import logging
import requests
from django.core.files.base import ContentFile
def get_profile_image(backend, user, response, is_new=False, *args, **kwargs):
if user is None:
return