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
""" | |
Sublime 3 xml_pp (xmltwig) based xml auto formatter. | |
Setup in Sublime: | |
- sudo apt-get install xml-twig-tools | |
- in Sublime go to menu: Tools -> New Plugin... | |
- paste this file into the editor. | |
- save: use the preset location (~/.config/sublime-text-3/Packages/User) | |
and name it exactly "xmlppformat.py". | |
- in Sublime go to menu: Preferences -> Key Bindings - User | |
- add an keybinding i.e.: |
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
<configure | |
xmlns="http://namespaces.zope.org/zope" | |
xmlns:browser="http://namespaces.zope.org/browser" | |
xmlns:security="http://namespaces.zope.org/security" | |
xmlns:zmi="http://namespaces.zope.org/zmi"> | |
<!-- Standard configuration directives --> | |
<include | |
file="configuration-meta.zcml" | |
package=".Configuration" | |
/> |
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
# jensens i3wm config | |
set $mainscreen LVDS1 | |
set $sidescreen VGA1 | |
# i3 config file (v4) | |
# | |
# Please see http://i3wm.org/docs/userguide.html for a complete reference! | |
set $mod Mod4 |
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
#!/bin/bash | |
# together with i3wm i bound this script to the blue thinkvantage button | |
# using: | |
# bindsym XF86Launch1 exec /usr/local/bin/toggle_touchpad.sh | |
# extract device id | |
DEVICE=`xinput --list|sed -n 's/.*SynPS\/2 Synaptics TouchPad.*id=\([0-9]*\).*/\1/p'` | |
# check its state |
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
1) use bootstrap.py from http://downloads.buildout.org/2/bootstrap.py | |
2) edit buildout.cfg and pin versions to: | |
[versions] | |
setuptools = 7.0 | |
zc.buildout = 2.2.5 | |
3) create a virtualenv as usal: |
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
<configure xmlns="http://namespaces.zope.org/zope" | |
xmlns:monkey="http://namespaces.plone.org/monkey"> | |
<include package="collective.monkeypatcher" file="meta.zcml" /> | |
<monkey:patch | |
description="Patch setLoginTimes to disable that feature." | |
class="Products.PlonePAS.tools.membership.MembershipTool" | |
original="setLoginTimes" | |
replacement=".patches.setLoginTimes" |
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
############################################################################## | |
# | |
# Copyright (c) 2006 Zope Foundation and Contributors. | |
# All Rights Reserved. | |
# | |
# This software is subject to the provisions of the Zope Public License, | |
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. | |
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED | |
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
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 acabsl import send | |
from acabsl import update | |
import acabsl | |
import colorsys | |
import random | |
import time | |
PLONE_RGB = (0, 131, 190) |
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 plone.app.querystring.queryparser import getPathByUID, getNavigationRoot | |
def _multi_path(context, row): | |
values = [] | |
for value in row.values.split(): | |
if not '/' in value: | |
# It must be a UID | |
value = '/'.join(getPathByUID(context, value)) | |
# take care of absolute paths without nav_root | |
nav_root = getNavigationRoot(context) |
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 unittest | |
import doctest | |
from pprint import pprint | |
from interlude import interact | |
from google.appengine.ext import testbed | |
optionflags = doctest.NORMALIZE_WHITESPACE | \ | |
doctest.ELLIPSIS | \ | |
doctest.REPORT_ONLY_FIRST_FAILURE |