This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aioftp | |
from fastapi import FastAPI, HTTPException, Request | |
from fastapi.responses import StreamingResponse | |
app = FastAPI() | |
@app.get('/fetch/{filename}', name='fetch') | |
async def ftp_fetch(request: Request, filename: str): | |
return StreamingResponse( | |
stream_file(filename), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {isServer} from 'solid-js/web' | |
import {createRouteData} from 'solid-start' | |
import {useRequest} from 'solid-start/server' | |
export default function FormPage() { | |
const postData = createRouteData(async () => { | |
const event = useRequest() | |
if (!isServer || event.request.method !== 'POST') { | |
return undefined | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configure | |
xmlns="http://namespaces.zope.org/zope" | |
xmlns:meta="http://namespaces.zope.org/meta" | |
xmlns:five="http://namespaces.zope.org/five"> | |
<include package="Zope2.App" /> | |
<include package="Products.Five" /> | |
<meta:redefinePermission from="zope2.Public" to="zope.Public" /> | |
<!-- Load the meta --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pkg_resources import parse_version | |
from zc.buildout.buildout import Buildout | |
def get_buildout(version): | |
versions_url = 'http://dist.plone.org/release/{version}/versions.cfg' | |
url = versions_url.format(version=version) | |
buildout = Buildout( | |
config_file=url, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[settings] | |
multi_line_output=3 | |
known_first_party=ames | |
default_section=THIRDPARTY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Definition: | |
=========== | |
from zope.schema.interfaces import IContextSourceBinder, IBaseVocabulary | |
class CatalogIndexValuesSource(object): | |
grok.implements(IContextSourceBinder, IBaseVocabulary) | |
def __init__(self, index_name): | |
self.index_name = index_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Definition: | |
=========== | |
from zope.schema.interfaces import IContextSourceBinder, IBaseVocabulary | |
class CatalogObjectProvidesSource(object): | |
grok.implements(IContextSourceBinder, IBaseVocabulary) | |
def __init__(self, interface): | |
self.interface = interface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ./add_hotfix.sh url md5hash [target basedir] | |
# i.e. ./add_hotfix.sh http://plone.org/products/plone-hotfix/releases/20110928/PloneHotfix20110928-1.0.zip aab87c2904754a2f6374f52c441fb97f /zeoclients/ | |
PATCHFILE="/tmp/$(basename $0).$$" | |
rm -rf "$PATCHFILE" | |
curl "$1" > "$PATCHFILE" | |
MD5=`openssl md5 "$PATCHFILE"|cut -d " " -f 2` | |
[[ $MD5 != $2 ]] && echo "Hashes do not match." && exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
catalog = context.portal_catalog | |
lexicon = catalog.htmlwordsplitter_lexicon | |
brains = catalog(Language='nl', portal_type='CoolPage') | |
words = dict(Title=0, Description=0, getText=0) | |
for brain in brains: | |
ob = brain.getObject() | |
words['Title'] = ob.Title().split() | |
words['Description'] = ob.Description().split() | |
words['getText'] = lexicon.parseTerms(ob.getText()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[buildout] | |
extends = | |
http://x.aclark.net/plone/4.1.x/develop.cfg | |
http://good-py.appspot.com/release/dexterity/1.1 | |
auto-checkout = | |
collective.z3cform.datagridfield | |
plone.app.relationfield | |
collective.z3cform.datagridfield_demo |
NewerOlder