Skip to content

Instantly share code, notes, and snippets.

View mvantellingen's full-sized avatar

Michael van Tellingen mvantellingen

  • Utrecht, The Netherlands
View GitHub Profile
@mvantellingen
mvantellingen / apps.py
Created November 22, 2016 09:58
wagtail performance hack
from django.apps import AppConfig
class CMSConfig(AppConfig):
name = 'myproj.apps.cms'
def ready(self):
from wagtail.wagtailcore.models import Site
root_paths = Site.get_site_root_paths()

Keybase proof

I hereby claim:

  • I am mvantellingen on github.
  • I am mvantellingen (https://keybase.io/mvantellingen) on keybase.
  • I have a public key ASC8-eS38tVDJR4p9Evixizm-G08LMoxSc786Jew1rVcwAo

To claim this, I am signing this object:

(function () {
$(function () {
var jwtUI =
'<div class="input"><input placeholder="JWT Token" id="input_jwt" name="jwt" type="text" size="20"></div>';
$(jwtUI).insertBefore('#api_selector div.input:last-child');
$("#input_apiKey").hide();
$('#input_jwt').change(addAuthorization);
});
function addAuthorization() {
var token = $('#input_jwt').val();
DELETE FROM catalogue_category;
INSERT INTO catalogue_category (path, depth, numchild, name, description, slug) values ("000J", 1, 13, "category 182", "", "category-182");
INSERT INTO catalogue_category (path, depth, numchild, name, description, slug) values ("000M", 1, 35, "category 1300", "", "category-1300");
INSERT INTO catalogue_category (path, depth, numchild, name, description, slug) values ("000D", 1, 10, "category 101", "", "category-101");
INSERT INTO catalogue_category (path, depth, numchild, name, description, slug) values ("0006", 1, 1, "category 56", "", "category-56");
INSERT INTO catalogue_category (path, depth, numchild, name, description, slug) values ("000B", 1, 69, "category 96", "", "category-96");
INSERT INTO catalogue_category (path, depth, numchild, name, description, slug) values ("000E", 1, 22, "category 114", "", "category-114");
INSERT INTO catalogue_category (path, depth, numchild, name, description, slug) values ("0008", 1, 1, "category 66", "", "category-66");
INSERT INT
@view_config(route_name='my-route')
def my_view(request):
# here i want to know if path-1 or path-2 was taken, preferably via a var n matchdict?
config.add_route('my-route', '/path-1/view')
config.add_route('my-route', '/path-2/view')
import datetime
import uuid
import psycopg2.extras
from sqlalchemy import Column, MetaData, Table
from sqlalchemy.types import Integer, DateTime, TypeDecorator
from sqlalchemy.dialects.postgresql import ARRAY, array
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.sql.expression import cast, literal, select