Skip to content

Instantly share code, notes, and snippets.

View jaroel's full-sized avatar

Roel Bruggink jaroel

View GitHub Profile
@jaroel
jaroel / site.zcml
Created April 4, 2016 20:21
Minimal site.zcml to make my Plone 5 instance running without z3c.autoinclude.
<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 -->
@jaroel
jaroel / solid-start-form-post-ssr.tsx
Created February 24, 2023 00:18
Use POST data in forms in SSR with SolidStart
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
}
@jaroel
jaroel / ftpproxy.py
Created July 16, 2023 15:39
ftp proxy with FastAPI
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),