Skip to content

Instantly share code, notes, and snippets.

View jedie's full-sized avatar

Jens Diemer jedie

View GitHub Profile
@jedie
jedie / migration_filer_deprecation_move.py
Created April 30, 2018 15:57 — forked from wfehr/migration_filer_deprecation_move.py
Migration to move deprecated cmsplugin-*-plugins to the newer djangocms-*-plugins
from django.apps import apps as global_apps
from django.db import migrations
from djangocms_file.models import get_templates as get_file_templates
from djangocms_picture.models import get_templates as get_picture_templates
def forwards_filer_file(apps, schema_editor):
try:
CMSPluginFilerFile = apps.get_model('cmsplugin_filer_file',
'FilerFile')
@jedie
jedie / example_output.txt
Created April 27, 2018 07:46
Compare own YAPF style with the defaults
_______________________________________________________________________________
*** Diff to 'PEP-8' style:
ALIGN_CLOSING_BRACKET_WITH_VISUAL_INDENT = False <- CHANGED reference is: True
BLANK_LINE_BEFORE_MODULE_DOCSTRING = True <- NEW (not in reference)
BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF = True <- CHANGED reference is: False
COLUMN_LIMIT = 119 <- CHANGED reference is: 79
DEDENT_CLOSING_BRACKETS = True <- CHANGED reference is: False
EACH_DICT_ENTRY_ON_SEPARATE_LINE = False <- CHANGED reference is: True
_______________________________________________________________________________
Discovery all dynamic fixtures...
Skip <MessagesConfig: messages> because it has no models
Skip <StaticFilesConfig: staticfiles> because it has no models
Skip <SiteMapsConfig: sitemaps> because it has no models
Skip <AppConfig: aldryn_common> because it has no models
WARNING ...es/django_tools/unittest_utils/logging_utils.py:114 There are warnings in: /usr/local/lib/python3.5/dist-packages/django_cms_tools/fixtures/languages.py
Fixture pages in app django_cms_tools has no Fixture class, skip.
Fixture languages in app django_cms_tools has no Fixture class, skip.
import pytest
def set_settings(app_config_class):
"""
Hack: Fill django settings with app-config settings
"""
from django.conf import settings
assert settings.configured
@jedie
jedie / friendica_bookmarklet.js
Last active March 28, 2018 10:17
friendica bookmarklet
javascript:void(window.open('https://<friendica-server>/bookmarklet?jump=doclose&url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title),'friendica','location=yes,links=no,scrollbars=no,toolbar=no,width=620,height=250'))
run-calculator$ ./setup.py linux
running linux
* Writing application template...
Template Python-Linux-template succesfully updated.
Project template: /home/jens/.cookiecutters/Python-Linux-template
* Installing requirements...
No requirements.
* Installing platform requirements...
Obtaining toga_core from git+https://github.com/pybee/toga.git@ebf314a0be85b5843f3ec9c38752dd07ba77a68a#egg=toga_core&subdirectory=src/core
Skipping because already up-to-date.
from __future__ import print_function, absolute_import, unicode_literals
from functools import partial
import datetime
from kivy.config import Config
import re
#!/usr/bin/env bash
# https://github.com/mitsuhiko/pipsi
CMD=pipsi
VENV_DIR=~/.local/venvs/pipsi
BIN_DIR=~/.local/bin
PACKAGES=$(cat <<EOF
-e git+https://github.com/mitsuhiko/pipsi.git#egg=pipsi
EOF
#!/usr/bin/env bash
VENV_DIR=$(pwd)/polar_venv
set -e
(
set -x
virtualenv --python=python2 ${VENV_DIR}
)
Environment:
Request Method: GET
Request URL: https://www.pylucid.org/de/admin/djangocms_blog/post/add/
Django Version: 1.8.14
Python Version: 3.5.0
Installed Applications:
('djangocms_admin_style',