Skip to content

Instantly share code, notes, and snippets.

View pysailor's full-sized avatar

Wolfgang Thomas pysailor

  • Munich, Germany
View GitHub Profile
@ctheune
ctheune / timetravel.py
Created February 3, 2015 13:29
Timetravel in unit tests
def test_something(now):
# now is a mock returned by a custom pytest fixture
with TimeTravel(now, datetime(2010, 1, 1)):
do_something_in_the_past()
do_something_at_the_regular_mocked_time()
class TimeTravel(object):
mac=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`
echo $mac
sudo ifconfig en0 ether $mac
@regebro
regebro / sanetizing_plone_views.rst
Last active December 15, 2015 21:29
Overview over ways to create views in Zope, and some opinions on their future.

Sanetizing Plone Views

(Pun intended)

There are too many ways of createing views in Plone. This needs fixing. It's a job that is too much for any one person, so we need a plan. This is an attempt to look at the situation and asses things so that we can make a plan, which can then be made into a PLIP and worked on.

@mezis
mezis / git-merge-po.sh
Last active November 20, 2023 11:33
Git merge driver for PO files
#!/bin/sh
#
# *******************************************
# WARNING: this does *not* handle 3-way merges properly.
# Anything modified on the local branch since the common base will get ignored.
#
# FOR ANYONE LANDING HERE:
# This script is now updated as part of the git-whistles gem.
# https://github.com/mezis/git-whistles
# *******************************************