Skip to content

Instantly share code, notes, and snippets.

@jean
jean / gist:6592939
Last active December 23, 2015 06:19
Plomino: profiling from the debug prompt
""" How to do Plomino profiling from debug prompt
"""
from zope.component.hooks import setSite
setSite(plone)
from sys import stdin, stdout
from ZPublisher.HTTPRequest import HTTPRequest
from ZPublisher.HTTPResponse import HTTPResponse
from ZPublisher.BaseRequest import RequestContainer
@jean
jean / Traceback
Created October 7, 2013 09:14 — forked from ivanteoh/Traceback
Traceback (innermost last):
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module <string>, line 4, in manage_importFromXML
Module AccessControl.requestmethod, line 70, in _curried
Module Products.CMFPlomino.PlominoReplicationManager, line 1384, in manage_importFromXML
Module <string>, line 5, in importFromXML
Module AccessControl.requestmethod, line 70, in _curried
Module Products.CMFPlomino.PlominoReplicationManager, line 1412, in importFromXML

Installed VoOm Hmm vimwiki now has backlinks. Look at upgrading.

Move `.vim/bundle/*` to vim-scripts, so they get latest. If I want to use a patched version, merge from jean fork manually. My forks checked out in `~/repos/git/`

# -*- coding: utf-8 -*-
#
# File: datagrid.py
#
# Copyright (c) 2008 by ['Eric BREHAULT']
#
# Zope Public License (ZPL)
#
__author__ = """Eric BREHAULT <eric.brehault@makina-corpus.com>"""
/*
* Author: Romaric BREIL <romaric.breil@supinfo.com>
*
* Those functions allow to manage Plomino datagrid fields.
*/
/*
* Displays the form (obtained by an AJAX request), and integrates it in the page.
* - field_id: id of the datagrid field
* - formurl: url of the form

[] rows.append(list(row)) rows.append(list(row)) rows.append(list(row))

Hacked `PloneHotfix20130618/in_portal.py` to work on Plone 2.5:

  9     def wrapped_in_portal(self, url, context=None):
 10         if url is None: # njj: ancient Plone
 11             url = ''
 12         url = re.sub('^[\x00-\x20]+', '', url).strip()
 13  ->     try:
 14             # njj: ancient Plone
 15             # return orig(self, url, context)
 16             return orig(self, url)

// ==UserScript==
// @name Wikipedia Table filter
// @namespace benibela
// @include http://*.wikipedia.org/wiki/*
// @include https://*.wikipedia.org/wiki/*
// ==/UserScript==
var tables = document.getElementsByClassName("wikitable");
var hiddenLists = new Array();
@jean
jean / testdb.xml
Created November 1, 2013 05:01 — forked from fulv/testdb.xml
<plominodatabase id="testdb">
<design>
<dbsettings version="1.18">
<AboutDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></AboutDescription>
<UsingDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></UsingDescription>
<IndexAttachments type="Products.Archetypes.Field.BooleanField">False</IndexAttachments>
<FulltextIndex type="Products.Archetypes.Field.BooleanField">True</FulltextIndex>
<IndexInPortal type="Products.Archetypes.Field.BooleanField">False</IndexInPortal>
<debugMode type="Products.Archetypes.Field.BooleanField">False</debugMode>
<CountDocuments type="Products.Archetypes.Field.BooleanField">False</CountDocuments>
@jean
jean / testdb2.xml
Last active December 27, 2015 15:49 — forked from fulv/gist:7311639
<plominodatabase id="testdb2">
<design>
<dbsettings version="1.18">
<AboutDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></AboutDescription>
<UsingDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></UsingDescription>
<IndexAttachments type="Products.Archetypes.Field.BooleanField">False</IndexAttachments>
<FulltextIndex type="Products.Archetypes.Field.BooleanField">True</FulltextIndex>
<IndexInPortal type="Products.Archetypes.Field.BooleanField">False</IndexInPortal>
<debugMode type="Products.Archetypes.Field.BooleanField">False</debugMode>
<CountDocuments type="Products.Archetypes.Field.BooleanField">False</CountDocuments>