View digits.py
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
class DigitsVerification: | |
DIGITS_API_URL = 'https://api.digits.com' | |
AUTH_PROVIDER_KEY = 'apiUrl' | |
CREDENTIALS_KEY = 'credentials' | |
def __call__(self, credentials): | |
auth_provider = self.validate_auth_provider(credentials) | |
if auth_provider is None: | |
return None |
View gist:d5da50d7ae54cd20990e4ddd6eba4ddb
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
<script> | |
function decodeURL() { | |
var uri_enc = document.getElementById("url").value; | |
var uri_dec = decodeURIComponent(uri_enc); | |
var text = document.getElementById("text"); | |
text.textContent = uri_dec; | |
} | |
</script> | |
<input id="url"> |
View 0002_migration_outdated.py
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
# -*- coding: utf-8 -*- | |
# Generated by Django 1.10.1 on 2016-09-23 05:48 | |
from __future__ import unicode_literals | |
from django.db import migrations | |
class Migration(migrations.Migration): | |
dependencies = [ |
View 0002_migration_outdated.py
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
# -*- coding: utf-8 -*- | |
# Generated by Django 1.10.1 on 2016-09-23 05:42 | |
from __future__ import unicode_literals | |
from django.db import migrations, models | |
class Migration(migrations.Migration): | |
dependencies = [ |
View django-jsonfield-length-sum-average.py
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
# Example usage of database funtions(`Sum` and `Avg`) and Django `JSONField`'s `jsonb_array_length` | |
# PostgreSQL json field functions: https://www.postgresql.org/docs/9.5/static/functions-json.html | |
# Django `F` and `Func`: https://docs.djangoproject.com/en/1.10/ref/models/expressions/#f-expressions | |
# Django aggregation: https://docs.djangoproject.com/en/1.10/topics/db/aggregation/ | |
# Django `JSONField`: https://docs.djangoproject.com/en/1.9/ref/contrib/postgres/fields/#jsonfield | |
# Given a model | |
class Contact(models.Model): | |
numbers = JSONField(help_text="An array of numbers") |
View wagtailredirectpage.py
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
# Thanks to Ethan Jucovy | |
# http://www.coactivate.org/projects/ejucovy/blog/2014/05/10/wagtail-notes-managing-redirects-as-pages/ | |
# This model comes from wagtaildemo | |
class LinkFields(models.Model): | |
link_external = models.URLField("External link", blank=True) | |
link_page = models.ForeignKey( | |
'wagtailcore.Page', | |
null=True, |
View colorpickerpanel.py
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
from django.conf import settings | |
from django.utils.safestring import mark_safe | |
from wagtail.wagtailadmin.edit_handlers import BaseFieldPanel | |
class BaseColorFieldPanel(BaseFieldPanel): | |
def render_js(self): | |
big_javascript_block = """ | |
(function() { |
View trello.py
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
""" Trello job challeng """ | |
from itertools import product | |
import sys | |
import unittest | |
letters = "acdegilmnoprstuw" | |
def pyhash(s): | |
""" |
View hallofontcolor.js
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
// hallo font color plugin | |
// (c) 2014 Alejandro Varas | |
// hallofontcolor may be freely distributed under the MIT license | |
(function(jQuery) { | |
return jQuery.widget("IKS.hallofontcolor", { | |
options: { | |
uuid: '', | |
colors: { | |
"#7bd148": "Green", |
View hallofontfamily.js
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
// hallo fontfamily plugin | |
// (c) 2014 Alejandro Varas | |
// hallofontfamily may be freely distributed under the MIT license | |
(function(jQuery) { | |
return jQuery.widget("IKS.hallofontfamily", { | |
options: { | |
uuid: '', | |
fonts: [ | |
// from http://web.mit.edu/jmorzins/www/fonts.html |
NewerOlder