Skip to content

Instantly share code, notes, and snippets.

This file contains a Python console block to lint

This contains an unknown variable:

>>> print("Hello")
'Hello'
>>> banana = "banana"
>>> for character in banana:
... print(characterr)
diff --git a/wagtailmedia/tests/test_views.py b/wagtailmedia/tests/test_views.py
index abbd40b..9df269f 100644
--- a/wagtailmedia/tests/test_views.py
+++ b/wagtailmedia/tests/test_views.py
@@ -484,7 +484,7 @@ class TestMediaChooserView(TestCase, WagtailTestUtils):
response = self.client.get(reverse('wagtailmedia:chooser'))
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'wagtailmedia/chooser/chooser.html')
- self.assertTemplateUsed(response, 'wagtailmedia/chooser/chooser.js')
+ self.assertTemplateUsed(response, 'wagtailmedia/chooser/chooser.html')
@johnfraney
johnfraney / models.py
Created January 31, 2019 05:02
Pygments-highlighted Wagtail StreamField code block
from django.utils.safestring import mark_safe
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import get_lexer_by_name
from wagtail.core import blocks
from home.ayu_style import AyuStyle
class CodeBlock(blocks.StructBlock):
@johnfraney
johnfraney / wagtail_hooks.py
Created April 3, 2018 15:38
Wagtail Draftail code block
import wagtail.admin.rich_text.editors.draftail.features as draftail_features
from wagtail.admin.rich_text.converters.html_to_contentstate import (
BlockElementHandler, InlineStyleElementHandler
)
from wagtail.core import hooks
@hooks.register('register_rich_text_features')
def register_code_block_feature(features):
"""
@johnfraney
johnfraney / designer.html
Last active August 29, 2015 14:20
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../google-map/google-map-search.html">
<polymer-element name="my-element">
<template>
<style>
:host {