This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Django Management Command to print a "Magic Link" for one-click login | |
by Jeff Triplett <jefftriplett> / https://twitter.com/webology | |
https://gist.github.com/jefftriplett/e87b36d750f94e48080a2be46e71dbe1 | |
Relies on: https://github.com/aaugustin/django-sesame | |
$ pip install django-click | |
$ pip install django-sesame[ua] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const camelCaseToKebabCase = (value) => { | |
if (typeof value !== 'string') return value | |
return value.replace(/[A-Z]/g, (char, index, wholeValue) => { | |
return wholeValue[index] = `${index === 0 ? '' : '-'}${char.toLowerCase()}` | |
}) | |
} | |
const getStyles = (element) => { | |
const elementStyles = {} |