I hereby claim:
- I am vangheem on github.
- I am vangheem (https://keybase.io/vangheem) on keybase.
- I have a public key ASCNjRhUMtWBRcsWbhvLA8bxXGTtTbURKVorvouxR9rsdwo
To claim this, I am signing this object:
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 |
def renderTiles(request, tree): | |
""" | |
copy from blocks minus ESI stuff | |
""" | |
site = getSite() | |
siteUrl = site.absolute_url() | |
try: | |
root = tree.getroot() | |
except AttributeError: |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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): |
from plone.tiles import Tile | |
from plone.app.z3cform.widget import RelatedItemsFieldWidget | |
from plone.app.standardtiles.image import image_scales | |
from plone.autoform import directives as form | |
from plone.supermodel import model | |
from zope import schema | |
from zope.component import getMultiAdapter | |
from zope.component.hooks import getSite | |
from zope.globalrequest import getRequest | |
from zope.interface import Invalid |
<tal:container tal:define="image python: view.get_image()"> | |
<div class="image-tile-container" tal:define="caption view/data/caption|nothing"> | |
<p class="image" tal:condition="nocall: image"> | |
<img src="${image/absolute_url}/@@images/image/${view/data/scale|large}" alt="${image/Title}" /> | |
<p class="description" tal:condition="caption">${caption}</p> | |
</p> | |
<p tal:condition="python: not image"> | |
No image specified | |
</p> |
/* globals define */ | |
define(function(){ | |
'use strict'; | |
var REGISTERED = {}; | |
var register = function(name, config){ | |
REGISTERED[name] = config; | |
}; |
# using aiobotocore and plone.server(aiohttp) | |
ob = await client.get_object(Bucket=bucket, Key=key) | |
info = ob['ResponseMetadata']['HTTPHeaders'] | |
resp = aiohttp.web.StreamResponse(headers=aiohttp.MultiDict({ | |
'CONTENT-DISPOSITION': 'attachment; filename="%s"' % self.filename, | |
'Content-Type': info['content-type'] | |
})) | |
resp.content_type = info['content-type'] | |
resp.content_length = info['content-length'] |
# | |
# Requirements: | |
# - Python >= 3.5 | |
# - requests | |
# - aiohttp | |
# | |
import argparse | |
import asyncio | |
import json | |
import os |
I hereby claim:
To claim this, I am signing this object: