Skip to content

Instantly share code, notes, and snippets.

View kcleong's full-sized avatar

Kim Chee Leong kcleong

  • Python United, Turftorr
  • The Netherlands, Groningen
View GitHub Profile
@kcleong
kcleong / plone_webpack.log
Created August 10, 2018 10:11
Trying to add plone webpack to an existing site
leong@KCs-MacBook-Pro  ~/projects/buildout-new   master ●  make watch
python bootstrap-buildout.py -c buildout.cfg
ez_setup.py is deprecated and when using it setuptools will be pinned to 33.1.1 since it's the last version that supports setuptools self upgrade/installation, check https://github.com/pypa/setuptools/issues/581 for more info; use pip to install setuptools
Creating directory '/Users/leong/projects/buildout-new/bin'.
Creating directory '/Users/leong/projects/buildout-new/parts'.
Creating directory '/Users/leong/projects/buildout-new/develop-eggs'.
Generated script '/Users/leong/projects/buildout-new/bin/buildout'.
bin/buildout -N install instance0 plonesite
Installing instance0.
Generated script '/Users/leong/projects/buildout-new/bin/instance0'.
@kcleong
kcleong / config.js
Last active August 13, 2018 11:55
/Plone/config.js
requirejs.config({
baseUrl: PORTAL_URL,
paths: {
"less": "++plone++static/components/less/dist/less",
"text": "++plone++static/components/requirejs-text/text",
"mockup-patterns-formautofocus": "++resource++mockup/formautofocus/pattern",
"mockup-patterns-tinymce": "++resource++mockup/tinymce/pattern",
"mockup-router": "++resource++mockupjs/router",
"mockup-patterns-relateditems-url": "++resource++mockup/relateditems",
"jquery.event.drop": "++resource++mockuplib/jquery.event.drop",
@kcleong
kcleong / less-variables.js
Created August 13, 2018 11:55
/Plone/less-variables.js
window.less = {
env: "development",
logLevel: 2,
async: false,
fileAsync: false,
errorReporting: window.lessErrorReporting || 'console',
poll: 1000,
functions: {},
relativeUrls: true,
@kcleong
kcleong / plone-webpack.diff
Last active May 31, 2019 08:57
Add missing webpack parts
diff --git a/resources/package.json b/resources/package.json
--- a/resources/package.json
+++ b/resources/package.json
@@ -22,7 +22,8 @@
"webpack-merge": "^4.1.0"
},
"dependencies": {
- "brace": "^0.10.0"
+ "brace": "^0.10.0",
+ "mockup": "git+https://github.com/plone/mockup.git#2.7.2"
@kcleong
kcleong / buildout.cfg
Last active September 6, 2018 19:07
Development buildout config
[buildout]
extends = buildout-dvl.cfg
parts +=
ipzope
instance0
zopepy
[versions]
ipython = 5.5
@kcleong
kcleong / zodb_index_fixer.py
Last active June 5, 2020 12:20
Plone ZODB index fixer
# -*- coding: utf-8 -*-
""" Plone ZODB index fixer
Usage
Execute script without committing changes (dry run):
./bin/instance run [path to script]/zodb_index_fixer.py
Execute script and commit changes:
@kcleong
kcleong / make.log
Created October 16, 2020 09:54
Plone webpack make with Plone 5.2.2
(NENV) (plone-webpack) ➜ example.buildout make
rm -f -r \
bin \
develop-eggs \
.installed.cfg \
parts \
resources/.plone \
resources/theme
/Users/leong/Envs/plone-webpack/bin/buildout -N install instance plonesite
Creating directory '/Users/leong/projects/plone-webpack/example.buildout/bin'.
(NENV) (plone-webpack) ➜ example-plone-5.2.1 make watch
make -j watch_plone watch_theme
bin/instance fg
sleep 10 # wait for Plone
/Users/leong/projects/plone-webpack/example-plone-5.2.1/eggs/Products.CMFUid-3.0.1-py2.7.egg/Products/CMFUid/UniqueIdHandlerTool.py:24: DeprecationWarning: InitializeClass is deprecated. Please import from AccessControl.class_init.
from App.class_init import InitializeClass
/Users/leong/projects/plone-webpack/example-plone-5.2.1/eggs/Products.GenericSetup-2.0.1-py2.7.egg/Products/GenericSetup/registry.py:16: ImportWarning: Not importing directory '/Users/leong/projects/plone-webpack/example-plone-5.2.1/eggs/Products.GenericSetup-2.0.1-py2.7.egg/Products/GenericSetup/xml': missing __init__.py
from xml.sax import parseString
2020-10-23 14:36:28,661 WARNING [Init:89][MainThread] Class Products.CMFFormController.ControllerPythonScript.ControllerPythonScript has a security declaration for nonexistent method 'ZPythonScriptHTML_changePrefs'
2020-10-23 14:36:28,669 WARNING [Init:89][M
@kcleong
kcleong / ha_starkvind.log
Created December 14, 2021 06:51
grep -i 0x4D79 home-assistant.log
2021-12-13 19:39:50 DEBUG (MainThread) [zigpy_znp.api] Received command: ZDO.TCDevInd.Callback(SrcNwk=0x4D79, SrcIEEE=b4:e3:f9:ff:fe:2b:07:3f, ParentNwk=0xB357)
2021-12-13 19:39:50 INFO (MainThread) [zigpy_znp.zigbee.application] TC device join: ZDO.TCDevInd.Callback(SrcNwk=0x4D79, SrcIEEE=b4:e3:f9:ff:fe:2b:07:3f, ParentNwk=0xB357)
2021-12-13 19:39:50 DEBUG (MainThread) [zigpy_znp.api] Received command: ZDO.TCDevInd.Callback(SrcNwk=0x4D79, SrcIEEE=b4:e3:f9:ff:fe:2b:07:3f, ParentNwk=0xB357)
2021-12-13 19:39:50 INFO (MainThread) [zigpy_znp.zigbee.application] TC device join: ZDO.TCDevInd.Callback(SrcNwk=0x4D79, SrcIEEE=b4:e3:f9:ff:fe:2b:07:3f, ParentNwk=0xB357)
2021-12-13 19:39:50 DEBUG (MainThread) [zigpy_znp.api] Received command: ZDO.EndDeviceAnnceInd.Callback(Src=0x4D79, NWK=0x4D79, IEEE=b4:e3:f9:ff:fe:2b:07:3f, Capabilities=<MACCapabilities.AllocateShortAddrDuringAssocNeeded|RXWhenIdle|MainsPowered|Router: 142>)
2021-12-13 19:39:50 INFO (MainThread) [zigpy_znp.zigbee.application] ZDO device announce: ZDO.E
@kcleong
kcleong / starkvind.log
Created December 16, 2021 07:03
grep -i 0x4D79 home-assistant.log
2021-12-14 20:22:22 DEBUG (MainThread) [zigpy.appdb] [0x4d79:1:0x0000] Attribute id: 4 value: IKEA of Sweden
2021-12-14 20:22:22 DEBUG (MainThread) [zigpy.appdb] [0x4d79:1:0x0000] Attribute id: 5 value: STARKVIND Air purifier
2021-12-14 20:22:22 DEBUG (MainThread) [zigpy.appdb] [0x4d79:1:0x0000] Attribute id: 4 value: IKEA of Sweden
2021-12-14 20:22:22 DEBUG (MainThread) [zigpy.appdb] [0x4d79:1:0x0000] Attribute id: 5 value: STARKVIND Air purifier
2021-12-14 20:22:22 DEBUG (MainThread) [zigpy.appdb] [0x4d79:1:0x0202] Attribute id: 1 value: 2
2021-12-14 20:22:22 DEBUG (MainThread) [zigpy.appdb] [0x4d79:1:0x0202] Attribute id: 0 value: 5
2021-12-14 20:22:25 DEBUG (MainThread) [homeassistant.components.zha.core.gateway] [0x4D79](IKEA of Sweden STARKVIND Air purifier) restored as 'available', last seen: 0:03:27 ago, consider_unavailable_time: 7200 seconds
2021-12-14 20:22:25 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x4D79](STARKVIND Air purifier): started initialization
2021-12-14 20:22:25 D