Similar to the Wordpress install, adapted for Wagtail. Runs for superusers when they log in to the admin.
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.db import models | |
from wagtail.wagtailsnippets.models import register_snippet | |
from wagtail.wagtailcore.models import Page | |
from wagtail.wagtailadmin.edit_handlers import InlinePanel | |
@register_snippet | |
class Category(models.Model): | |
""" |
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
#!/bin/bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
upstream='upstream/master' | |
if ! ( git diff --exit-code && git diff --cached --exit-code ) ; then | |
echo "Working tree is dirty, aborting" | |
exit 1 |
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
#!/bin/bash | |
# A dodgy ripoff of rsync for my music files | |
# | |
# Usage: To copy the contents of "Zechs Marquise/Getting Paid/" and "Grails/" | |
# from your music library to your mounted phone: | |
# | |
# syncdir --source $HOME/Music \ | |
# --destination /mnt/phone/Music \ | |
# "Zechs Marquise/Getting Paid/" \ | |
# "Grails/" |
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
<h2>{{ page.title }}</h2> | |
{# As 'header' is in 'sizes' for BlogPost.feature_image, this rendition will be already present #} | |
{% image page.feature_image header %} | |
{# Can also use any old filter here, does not need to be one of 'sizes', or a nickname #} | |
{% image page.feature_image height-200 %} | |
{{ page.body }} |
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 started on Wed 27 May 2015 12:44:03 AEST | |
test@nightjar:~$ export EDITOR=nvim | |
test@nightjar:~$ export VISUAL=nvim | |
test@nightjar:~$ env | |
XDG_VTNR=1 | |
XDG_SESSION_ID=3 | |
COMP_WORDBREAKS= | |
"'><;|&(: | |
SHELL=/bin/bash | |
TERM=screen-256~color |
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 wagtail.contrib.wagtailroutablepage.models import RoutablePageMixin | |
from wagtail.wagtailcore.models import Page | |
from .viewproxy import ViewModuleProxy | |
views = ViewModuleProxy('myapp.views') | |
class MyPage(Page): | |
serve = views.mypage | |
class MyRoutablePage(RoutablePageMixin, Page): |
I hereby claim:
- I am mx-moth on github.
- I am tim_heap (https://keybase.io/tim_heap) on keybase.
- I have a public key whose fingerprint is DEDD 4853 A4B8 C769 239E 093F EA85 6746 0ACC B8C2
To claim this, I am signing this object:
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
"use strict"; | |
function processNodeList(list, target) { | |
list.forEach(function(node) { | |
processNode(node, target); | |
}); | |
} | |
function processNode(node, target) { | |
switch (node._type) { |