Skip to content

Instantly share code, notes, and snippets.


Welcher Selemium Selektor findet das 2. div?

    <div class="hidden" id="foo">
        Ich bin unsichtbar.

    <div id="foo">
        Hallo Robot
tomgross /
Last active May 9, 2022
Homebrew Cask for installing pCloud on a Mac

Installing pCloud with Homebrew Cask

Since this recipe was rejected because of the volatile nature of pCloud links (see homebrew-cask#57634) I try to maintain this myself because it is useful to me and might be for others.

  • Download pcloud-drive.rb.
  • Run brew cask install pcloud-drive.rb.

To uninstall run brew cask uninstall pcloud-drive.rb.

# -*- coding: utf-8 -*-
from plone import api
from plone.behavior.interfaces import IBehaviorAssignable
from plone.dexterity.interfaces import IDexterityFTI
from plone.dexterity.interfaces import IDexteritySchema
from plone.namedfile.interfaces import INamedBlobFileField
from plone.namedfile.interfaces import INamedImageField
from z3c.caching.interfaces import IPurgePaths
from zope.component import adapter
from zope.component import getUtility
tomgross /
Last active Jun 15, 2017
Plone Python 3 coredev buildout
git clone coredev-py3
cd coredev-py3
python3 -m venv .
bin/pip install -U setuptools==33.1.1 zc.buildout==2.8.0
./bin/buildout -c experimental/py3x-test.cfg
tomgross /
Last active Mar 17, 2017 — forked from simonjenny/
Fairytale Phone
import RPi.GPIO as GPIO
GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_UP)
c = 0
last = 1
tomgross /
Last active Apr 10, 2019
Check the coverage of Python tests and compare with previous run in gitlab
# This script checks the coverage and test if it keeps at least the same
# Add this to your .gitlab-ci.yml
# coveragetest:
# ...
# cache:
# paths:
# - coverage_value.txt
# script:
# - bin/coverage run bin/test
# dynamically get JAVA_HOME on Fedora, CentOS, RHEL
JAVA_HOME=`alternatives --display java | sed -n 's/^Current .best. version is \(.*\)\/bin\/java\.$/\1/p'`
tomgross /
Last active Oct 14, 2021
Recreating a messed up github pull request
# 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
tomgross /
Last active Aug 25, 2016
Extract authenticator in Zope / Plone form
curl -u admin:admin http://localhost:8080/Plone/portal_quickinstaller/manage_installProductsForm -q | grep -oP '_authenticator.*value="\K[a-z0-9]*' | head -1
tomgross / buildout.cfg
Last active Aug 29, 2015
Plone WSGI deployment
View buildout.cfg
parts = instance wsgiconf app
extends =
recipe = plone.recipe.zope2instance
user = admin:admin
http-address =
eggs =