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
// Sendbird widget | |
#sb_widget | |
.widget | |
background-color: $primary !important | |
&:hover | |
background-color: darken($primary, 10%) !important | |
.channel-board .board-top | |
background-color: $primary !important |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from django.apps import apps | |
from django.db.models import get_models | |
from django.core.management.base import BaseCommand | |
from django.contrib.auth.management import create_permissions | |
class Command(BaseCommand): |
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
import re | |
import unicodedata | |
try: | |
from django.utils.encoding import smart_unicode as smart_text | |
except ImportError: | |
from django.utils.encoding import smart_text | |
SLUG_OK = '_' |
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
import json | |
from django.http import HttpResponse | |
def json_responder(**kwargs): | |
""" | |
Return a HTTP response to json format | |
""" | |
return HttpResponse(json.dumps(kwargs), content_type="application/json") |
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
""" | |
Paste the code at the end your main settings. | |
It will import all settings files of your django project. | |
It allow to divide settings per app. | |
""" | |
import os.path | |
for d in [d for d in os.listdir(os.path.dirname(__file__)) if os.path.isdir(os.path.join(os.path.dirname(__file__), d))]: | |
app = __import__(d) |
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
import mimetypes | |
def is_txt_file(file): | |
"""Test if the file is a txt file.""" | |
mime = mimetypes.guess_type(file) | |
if mime[0] == 'text\plan': | |
return True |
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
import struct | |
def get_os_struct(): | |
"""Get system os struct.""" | |
return str(struct.calcsize('P') * 8) |