Skip to content

Instantly share code, notes, and snippets.

View toutpt's full-sized avatar
👨‍💻

Jean-Michel toutpt

👨‍💻
View GitHub Profile
@toutpt
toutpt / collective-classifiers.py
Last active September 29, 2015 17:47
common classifiers for collective addons
classifiers=[
"Environment :: Web Environment",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Operating System :: OS Independent",
"Framework :: Zope2",
"Framework :: Plone",
"Framework :: Plone :: 4.0",
"Framework :: Plone :: 4.1",
"Framework :: Plone :: 4.2",
"Framework :: Plone :: 4.3",
@toutpt
toutpt / buildout.cfg
Created January 21, 2012 11:09
TMP: reply to question on ML
############################################
#
# Buildout Configuration File for Standalone Plone
# ------------------------------------------------
# $LastChangedDate: 2009-05-24 11:24:17 -0700 (Sun, 24 May 2009) $
$LastChangedRevision: 27095 $
#
# After making changes in this configuration file,
# you should run bin/buildout to update the components.
#
@toutpt
toutpt / balancer.conf.template
Created January 27, 2012 13:21
cyn.in production configuration
# This is the default haproxy load balancing configuration. It uses will
# load balance four ZEO clients.
#
# Note that balancer.conf is generated from balancer.conf.template.
#
global
log ${host:syslog} local6
# We manage this with supervisor
@toutpt
toutpt / .gitignore
Created February 9, 2012 14:25 — forked from kiorky/.gitignore
test
bin
develop-eggs
.installed.cfg
.mr.developer.cfg
*.egg-info
*.pyc
parts
@toutpt
toutpt / plonedeps.sh
Created February 19, 2012 18:28
linux dependencies for Plone
#utilities to download and extract
apt-get install wget curl tar unzip bzip2 gzip readline-common
#system deps
apt-get install libxml2 libxslt1 libjpeg62 libpng12-0 libpng3
#compile stuff
apt-get install build-essentials python-dev
apt-get install libssl-dev zlib1g-dev libreadline5-dev libjpeg62-dev libxml2-dev libxslt1-dev
@toutpt
toutpt / prod.cfg
Created March 3, 2012 22:02
plone4 commpn production buildout file
[buildout]
extends =
buildout.cfg
var/sys.cfg
parts=
instance
zopepy
zeoserver
instance1
@toutpt
toutpt / propertiestool.xml
Created March 28, 2012 14:38
optimized configuration for ckeditor in Plone
<?xml version="1.0"?>
<object name="portal_properties" meta_type="Plone Properties Tool">
<object name="ckeditor_properties" meta_type="Plone Property Sheet">
<property name="title">CKEditor properties</property>
<!-- base properties -->
<property name="forcePasteAsPlainText" type="boolean">True</property>
<property name="toolbar" type="string">Custom</property>
<property name="toolbar_Custom" type="text">
[
['Save','Format','Styles'],
@toutpt
toutpt / more_url.py
Created March 29, 2012 12:06
from topic to @@search from
from urllib import urlencode, quote_plus
from plone.memoize.view import memoize
from DateTime.DateTime import DateTime
from Products.Five import BrowserView
from Products.CMFCore.utils import getToolByName
class RelatedItems(BrowserView):
def __init__(self, context, request):
self.context = context
self.request = request
@toutpt
toutpt / language_negotiation.py
Created April 11, 2012 09:39
Language negotiator that use user's language preference
################################################################
# (C) 2012, ZOPYX Ltd.
################################################################
#ZCML:
#<subscriber handler=".language_negotiation.Negotiator"/>
from zope.interface import Interface
from zope.component import adapter
from ZPublisher.interfaces import IPubEvent,IPubAfterTraversal
from Products.CMFCore.utils import getToolByName
@toutpt
toutpt / rvocabulary.py
Created August 14, 2012 15:43
registry vocabulary
from zope import component
from zope import interface
from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
from zope.schema.interfaces import IVocabularyFactory
from plone.i18n.normalizer.base import baseNormalize
class RegistryVocabulary(object):
"""vocabulary to use with plone.app.registry"""
interface.implements(IVocabularyFactory)