Skip to content

Instantly share code, notes, and snippets.

Avatar

Nathan Van Gheem vangheem

View GitHub Profile
@vangheem
vangheem / widget.py
Last active September 11, 2015 16:12
View widget.py
import zope.interface
import zope.schema.interfaces
import z3c.form.interfaces
import z3c.form.browser.textarea
import z3c.form.widget
from plone.app.z3cform.widget import RelatedItemsWidget
class MyRelatedItemsWidget(RelatedItemsWidget):
@vangheem
vangheem / 0_reuse_code.js
Last active August 29, 2015 14:09
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@vangheem
vangheem / gist:2c625d89c33c1010662c
Created June 26, 2014 13:26
alternative renderTiles
View gist:2c625d89c33c1010662c
def renderTiles(request, tree):
"""
copy from blocks minus ESI stuff
"""
site = getSite()
siteUrl = site.absolute_url()
try:
root = tree.getroot()
except AttributeError:
@vangheem
vangheem / gist:6358511
Created August 27, 2013 20:11
archetypes note patch
View gist:6358511
import transaction
from copy import deepcopy
from cgi import escape
from cStringIO import StringIO
from logging import ERROR
from types import ClassType, FileType, StringType, UnicodeType
from zope.contenttype import guess_content_type
from zope.i18n import translate