Skip to content

Instantly share code, notes, and snippets.

View zopyx's full-sized avatar

Andreas Jung zopyx

View GitHub Profile
@zopyx
zopyx / gist:9432065
Created March 8, 2014 15:15
keybase.md
### Keybase proof
I hereby claim:
* I am zopyx on github.
* I am andreasjung (https://keybase.io/andreasjung) on keybase.
* I have a public key whose fingerprint is 1BA1 A581 53D5 D64C 9EF4 2F04 C2F0 707B 66ED 097A
To claim this, I am signing this object:
2014-03-25T12:13:32 WARNING Plone Deprecation Warning
The icon for the 'site_actions/sitemap' action was obtained from the action icons tool. The action icons tool has been deprecated and will be removed in Plone 5. You should register action icons directly on the action now, using the 'icon_expr' setting.
------
2014-03-25T12:13:32 WARNING Plone Deprecation Warning
The icon for the 'site_actions/accessibility' action was obtained from the action icons tool. The action icons tool has been deprecated and will be removed in Plone 5. You should register action icons directly on the action now, using the 'icon_expr' setting.
------
2014-03-25T12:13:32 WARNING Plone Deprecation Warning
The icon for the 'site_actions/contact' action was obtained from the action icons tool. The action icons tool has been deprecated and will be removed in Plone 5. You should register action icons directly on the action now, using the 'icon_expr' setting.
def linked_object_obj(self, obj):
print obj
try:
o = obj.getObject()
except Exception:
o = None
return o
Stacktrace (aktuellster Aufruf als letztes):
File "zc/lockfile/__init__.py", line 84, in __init__
_lock_file(fp)
File "zc/lockfile/__init__.py", line 59, in _lock_file
raise LockError("Couldn't lock %r" % file.name)
mac=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`
echo $mac
sudo ifconfig en0 ether $mac
@zopyx
zopyx / gist:95168f75d91d7b2e469c
Last active August 29, 2015 14:02
pyfilesystem and webdav
(Pdb) DAVFS('http://localhost:6080/exist/webdav/db/output//de/onkopedia/leitlinien/gastrointestinale-stromatumore-gist/current/', dict(username='admin', password='xx'))
<DAVFS: http://localhost:6080/exist/webdav/db/output//de/onkopedia/leitlinien/gastrointestinale-stromatumore-gist/current/>
(Pdb) DAVFS('http://localhost:6080/exist/webdav/db/output//de/onkopedia/leitlinien/gastrointestinale-stromatumore-gist/current/', dict(username='admin', password='xx')).listdir()
[u'metadata.json', u'styles.css', u'index-styles-inline.html', u'index_original_html.bin', u'gastrointestinale-stromatumore-gist.pdf', u'index.html']
(Pdb) DAVFS('http://localhost:6080/exist/webdav/db/output//de/onkopedia/leitlinien/gastrointestinale-stromatumore-gist/current/', dict(username='admin', password='xx')).open('index.html', 'wb')
*** ResourceNotFoundError: Resource not found: index.html
@zopyx
zopyx / gist:30de75cf3ae46110653e
Last active August 29, 2015 14:03
prefix matching lexicon
>>> lexicon = app.eteaching.portal_catalog.plone_lexicon
>>> words = lexicon.words()
>>> result = [w for w in words if w.startswith('foerd')]
>>> print result
['foerderbedingungen', 'foerderinstitutionen', 'foerdern', 'foerderpgm', 'foerderphasen', 'foerderprogramm', 'foerderprogramme', 'foerderprogrammen', 'foerderprojekte', 'foerderung', 'foerderung_uebersicht', 'foerderungen', 'foerderungsprogramm', 'foerderverein']
#
rom pyPdf import PdfFileWriter
from pyPdf import PdfFileReader
from reportlab.pdfgen import canvas
from cStringIO import StringIO
def stamp_pdf(in_pdfname, image_name):
pdf_in = PdfFileReader(file(in_pdfname, "rb"))
def context_property(name):
def getter(self):
return getattr(self.context, name)
def setter(self, value):
setattr(self.context, name, value)
def deleter(self):
delattr(self.context, name)
return property(getter, setter, deleter)
certificate_vocabulary = SimpleVocabulary([
xquery version "3.0";
module namespace services = "http://my/services";
import module namespace transform = "http://exist-db.org/xquery/transform";
declare namespace rest = "http://exquery.org/ns/restxq";
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
declare
%rest:GET