Skip to content

Instantly share code, notes, and snippets.

@tomgross
tomgross / gist:4956024
Created Feb 14, 2013
Plone HTML5 calendar_macros. Be careful! This does not work aout of the box. It needs a slightly modified date_components_support-view and process_form-method of the widget.
View gist:4956024
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="plone">
<body>
<tal:comment tal:condition="nothing">
The calendar date picker.
</tal:comment>
View buildout.cfg
[buildout]
newest = false
extends =
http://dist.plone.org/release/3.3.5/versions.cfg
parts =
zope2
instance
[zope2]
@tomgross
tomgross / gist:6054493
Created Jul 22, 2013
VS PyTools MSbuild error
View gist:6054493
Overall Build Process
00:00
Update Build Number
00:02
Run On Agent (reserved build agent Default Agent - ASARA156)
00:00
Create Workspace
00:00
Get Workspace
@tomgross
tomgross / gist:7256426
Last active Dec 27, 2015
operationsmanager control
View gist:7256426
/* XXX Post to TFS */
function follow_href(title) {
$('a[title="' + title + '"]').click(function() {
window.location = $(this).attr("href");
});
$('a[title="' + title + '"]').trigger('click');
}
View Test Results
Running Products.PloneTestCase.layer.PloneSite tests:
Set up Testing.ZopeTestCase.layer.ZopeLite in 0.920 seconds.
Set up Products.PloneTestCase.layer.ZCML <module 'plone.dexterity.fti' from '/home/tom/eggs/plone.dexterity-2.2.3-py2.7.egg/plone/dexterity/fti.pyc'>
in 10.251 seconds.
Set up Products.PloneTestCase.layer.PloneSite in 12.654 seconds.
/home/tom/eggs/Products.CMFCore-2.2.7-py2.7.egg/Products/CMFCore/DirectoryView.py:493: UserWarning: DirectoryView classic_ecmascript refers to a non-existing path 'plonetheme.classic:skins/classic_ecmascript'
(self.id, reg_key), UserWarning)
Failure in test testDoUpgrades (plone.app.upgrade.tests.test_upgrade.TestUpgrade)
@tomgross
tomgross / gist:d059653bfe3948521d8f
Created Aug 6, 2014
Test failures of PortalTransforms with lxml cleaner
View gist:d059653bfe3948521d8f
Failure in test testPolicy (Products.PortalTransforms.tests.test_engine.TestEngine)
Traceback (most recent call last):
File "/opt/Python273/lib/python2.7/unittest/case.py", line 327, in run
testMethod()
File "/home/tom/projects/buildout.coredev/src/Products.PortalTransforms/Products/PortalTransforms/tests/test_engine.py", line 206, in testPolicy
self.assertEqual(cache.getData(), '<p>this is safe</p>')
File "/opt/Python273/lib/python2.7/unittest/case.py", line 511, in assertEqual
assertion_func(first, second, msg=msg)
File "/opt/Python273/lib/python2.7/unittest/case.py", line 504, in _baseAssertEqual
raise self.failureException(msg)
View designer.html
<link rel="import" href="../google-map/google-map.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-ajax/core-ajax.html">
<link rel="import" href="../speech-mic/speech-mic.html">
<link rel="import" href="../smoothie-chart/smoothie-chart.html">
<polymer-element name="my-element">
<template>
@tomgross
tomgross / buildout.cfg
Last active Aug 29, 2015
Plone WSGI deployment
View buildout.cfg
[buildout]
parts = instance wsgiconf app
extends = http://dist.plone.org/release/5-latest/versions.cfg
[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
http-address =
eggs =
Plone
@tomgross
tomgross / parse_token.sh
Last active Aug 25, 2016
Extract authenticator in Zope / Plone form
View parse_token.sh
#!/bin/sh
curl -u admin:admin http://localhost:8080/Plone/portal_quickinstaller/manage_installProductsForm -q | grep -oP '_authenticator.*value="\K[a-z0-9]*' | head -1
@tomgross
tomgross / recreate.sh
Last active Oct 14, 2021
Recreating a messed up github pull request
View recreate.sh
# if some commits landed erroneous in a PR on github
# this commands help to start fresh from master
# replace `my_pr_branch` with the name of the branch of your pull request
git checkout my_pr_branch
git diff master > ../pr.patch
git checkout master
git branch -D my_pr_branch
# make sure it is the *SAME* name than the branch you deleted