Skip to content

Instantly share code, notes, and snippets.

View pysailor's full-sized avatar

Wolfgang Thomas pysailor

  • Munich, Germany
View GitHub Profile
@pysailor
pysailor / webpack.config.js
Created February 7, 2019 09:25
Webpack example config fo the chunkFilename part and the CommonsChunkPlugin.
const merge = require('webpack-merge');
const webpack = require('webpack');
const path = require('path');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
var baseConfig = require('./extra.config.js');
module.exports = merge(baseConfig, {
entry: {
@pysailor
pysailor / gist:772c4ae5f0ce7fd23ac6
Created February 19, 2015 13:17
Plone: Override a browser view while keeping the original template
Basically, http://docs.plone.org/develop/addons/components/zcml.html#specify-files-and-code-from-another-package explains how to do it. But the example is not very clear, since in both cases the same packge is referenced. Therefore, a simple example:
Suppose you want to overwrite the folder_contents view in Plone. You only need to change some code in the class and you're happy with the template.
The view is defined in plone.app.content.browser with this zcml statement:
<browser:page
for="Products.CMFCore.interfaces._content.IFolderish"
class=".folder.FolderContentsView"
name="folder_contents"
@pysailor
pysailor / gist:238709bf1b0e839b1f5b
Last active February 10, 2017 22:14
keybase.md
### Keybase proof
I hereby claim:
* I am pysailor on github.
* I am pysailor (https://keybase.io/pysailor) on keybase.
* I have a public key ASCP1lYVWYNfnEq5PcS7dE1rrY6djT1QzS44HvyVatIRtQo
To claim this, I am signing this object:
@pysailor
pysailor / gist:d2cfa99c6d7e2e63fe0c
Last active August 29, 2015 14:03
Expose a vocabulary from ATVocabularyManager to be used with dexterity content types
"""
This example assumes you have a simple (flat) vocabulay named `available-languages`
in portal_vocabularies
"""
# This would be your vocabularies.py
from Products.CMFCore.utils import getToolByName
from zope.interface import implementer