Skip to content

Instantly share code, notes, and snippets.

Tom Gross tomgross

Block or report user

Report or block tomgross

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View foo.md

Welcher Selemium Selektor findet das 2. div?

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

    <div id="foo">
        Hallo Robot
    </div>
@tomgross
tomgross / README.md
Last active May 10, 2019
Homebrew Cask for installing pCloud on a Mac
View README.md

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.

View purge_images.py
# -*- 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
tomgross / plone_py3.sh
Last active Jun 15, 2017
Plone Python 3 coredev buildout
View plone_py3.sh
#!/bin/bash
git clone git@github.com:plone/buildout.coredev.git 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
tomgross / phone.py
Last active Mar 17, 2017 — forked from simonjenny/phone.py
Fairytale Phone
View phone.py
#!/usr/bin/python
import RPi.GPIO as GPIO
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
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
tomgross / check_coverage.py
Last active Apr 10, 2019
Check the coverage of Python tests and compare with previous run in gitlab
View check_coverage.py
# 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
View get_java_home.sh
# 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
tomgross / recreate.sh
Last active Jul 14, 2017
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
@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 / 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
You can’t perform that action at this time.