Skip to content

Instantly share code, notes, and snippets.

View ale-rt's full-sized avatar

Alessandro Pisa ale-rt

View GitHub Profile
@ale-rt
ale-rt / gist:7820888
Last active December 30, 2015 11:09
SQLLite
apt-get install libsqlite3-0 libsqlite3-dev sqlite3
[saconfig]
recipe = collective.recipe.template
sqlalchemy_url = sqlite:///${buildout:directory}/var/albo.db
sqlalchemy_extras = 
input = ${buildout:directory}/templates/arpa.albo.zcml.in
output = ${buildout:directory}/etc/arpa.albo.zcml

If you got this error:

kees@zeno:~/Projects/buildout.coredev$ xvfb-run ./bin/test -m Products.CMFPlone
Running Products.CMFPlone.testing.CMFPloneLayer:Functional tests:
  Set up plone.testing.zca.LayerCleanup in 0.000 seconds.
  Set up plone.testing.z2.Startup in 0.147 seconds.
  Set up plone.app.testing.layers.PloneFixture in 5.623 seconds.
  Set up plone.app.event.testing.PAEventLayer in 0.562 seconds.
  Set up plone.app.contenttypes.testing.PloneAppContenttypes in 1.353 seconds.
  Set up Products.CMFPlone.testing.ProductsCMFPloneLayer in 0.078 seconds.
@ale-rt
ale-rt / dx-overrire-nexturl.py
Created November 19, 2015 08:16
Dexterity example: override nextURL
class BaseEditForm(DefaultEditForm):
def nextURL(self):
''' Try to guess in a smart way what will bethe next url
'''
next_url = super(BaseEditForm, self).nextURL()
current_tab = getattr(self, 'tab_id', '')
if not current_tab:
return next_url
if not current_tab in self.wizard_tabs:
@ale-rt
ale-rt / cssfrompngs
Created May 14, 2015 16:32
Script that creates css rules to add background png images with data-uris
#!/usr/bin/env python
from PIL import Image
from base64 import encodestring
import sys
template = '''.%(classname)s {
width: %(width)spx;
height: %(height)spx;
background-repeat: no-repeat;