This file contains hidden or 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 | |
| from functools import partial | |
| import bs4 | |
| from content_editor.admin import ContentEditorInline | |
| from django.db import models | |
| from django.utils.translation import gettext_lazy as _ | |
| from django_prose_editor.fields import ( | |
| ProseEditorField, | |
| create_sanitizer, |
This file contains hidden or 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
| /** | |
| * ClassLoom Extension | |
| * | |
| * Adds CSS class management to ProseMirror nodes and marks. | |
| * Works with any node type (paragraphs, tables, lists, etc.) and any mark type (italic, bold, etc.). | |
| * | |
| * Features: | |
| * - Multiple class groups targeting different node/mark types | |
| * - Combinable groups (multiple classes from same group) | |
| * - Special "text" type: creates one separate mark per group (allows combining multiple text class groups) |
This file contains hidden or 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 python3 | |
| """ | |
| Extract strings:: | |
| python3 extract_gettext.py | |
| Run tests:: | |
| python3 -m doctest -v extract_gettext.py |
This file contains hidden or 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 asyncio | |
| from datetime import datetime | |
| from channels.consumer import AsyncConsumer | |
| # from channels.http import AsgiRequest | |
| class AsyncHttpConsumer(AsyncConsumer): | |
| async def __call__(self, receive, send): | |
| self.send = send |
This file contains hidden or 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 import template | |
| from django.template.base import Variable | |
| register = template.Library() | |
| @register.simple_tag(takes_context=True) | |
| def safeimage(context, imagefile, spec): | |
| """ |
This file contains hidden or 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 io | |
| import os | |
| from django import template | |
| from django.conf import settings | |
| from django.utils.html import mark_safe | |
| from webpack_loader import utils | |
This file contains hidden or 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 __future__ import unicode_literals | |
| from modeltranslation.translator import translator, TranslationOptions | |
| from naturnetz.models import Branch, Staffer, StickyNote | |
| def translation_options(model, **options): | |
| translator.register( | |
| model, |
This file contains hidden or 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.core.management.base import BaseCommand | |
| from feincms.module.page.models import Page | |
| class Command(BaseCommand): | |
| def add_arguments(self, parser): | |
| parser.add_argument('from_pk', type=int) | |
| parser.add_argument('to_language', type=str) |
This file contains hidden or 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 | |
| from __future__ import print_function | |
| from bs4 import BeautifulSoup | |
| import re | |
| import requests | |
| from django.core.management.base import BaseCommand | |
| from django.utils.encoding import force_text |
This file contains hidden or 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 Botkit = require('botkit'); | |
| const request = require('superagent'); | |
| const controller = Botkit.slackbot(); | |
| // Slack Bot starten; und unendlich viele Wieder-Verbindungen zulassen | |
| controller.spawn({ | |
| token: process.env.SLACK_BOT_TOKEN, | |
| retry: Infinity, | |
| }).startRTM(function (err, bot, payload) { | |
| if (!err) return; |
NewerOlder