Skip to content

Instantly share code, notes, and snippets.

View Sieboldianus's full-sized avatar
💭
🌊

Alexander Dunkel Sieboldianus

💭
🌊
View GitHub Profile
@Sieboldianus
Sieboldianus / iframe.php
Created January 31, 2022 11:56
Stackoverflow as iframe with php file_get_contents();
<!DOCTYPE html><html>
<?php
$url = 'https://stackoverflow.com/questions/5710867/downloading-and-unzipping-a-zip-file-without-writing-to-disk&noredirect=1';
$site = file_get_contents($url);
$site = preg_replace('#<div class="ff-sans ps-fixed z-nav-fixed ws4 sm:w-auto p32 sm:p16 bg-black-750 fc-white bar-lg b16 l16 r16 js-consent-banner">(.*?)</div>#s', ' ', $site);
$site = preg_replace('~<\s*\bscript\b[^>]*>(.*?)<\s*\/\s*script\s*>~is', ' ', $site);
echo $site
?>
</html>
from fastapi import FastAPI
from pydantic import BaseModel, validator, BaseConfig
from geoalchemy2 import WKTElement
from geoalchemy2.shape import to_shape
"""Minimum working example snippet for handling lat lng coordinates and geometry types using Fastapi"""
app = FastAPI()