Skip to content

Instantly share code, notes, and snippets.

# 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 / check_coverage.py
Last active April 10, 2019 14:33
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
@tomgross
tomgross / phone.py
Last active March 17, 2017 21:36
Fairytale Phone
#!/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 / plone_py3.sh
Last active June 15, 2017 19:01
Plone Python 3 coredev buildout
#!/bin/bash
git clone [email protected]: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
# -*- 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 / README.md
Last active August 6, 2024 07:39
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.

Welcher Selemium Selektor findet das 2. div?

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

    <div id="foo">
        Hallo Robot