Skip to content

Instantly share code, notes, and snippets.

View larsloQ's full-sized avatar

larslo larsloQ

View GitHub Profile
@larsloQ
larsloQ / gist:a30471b3d42dbc7f72e69455ffe90719
Created October 19, 2022 11:44
SLIM-Framework based Micro-Proxy for accessing private Google Calendar URLS via JS
<?php
/**
* Background:
* A website I made wanted to show the pricing and availablity of some houses the offer for rent.
* they managed these data via simple google calendars, one for bookings/availabiliy and
* one where they enter prices for each day via recurring events a couple of weeks in advance.
*
* since google private calendar urls can not be access via JS (due to CORS)
* We need a proxy where we can controll CORS-Headers.
@larsloQ
larsloQ / gist:a3eb75b0a9d57705a11f665de074d94b
Created September 6, 2022 20:03
Run Flask on Shared Hosting (Hoster Webgo.de)
---- File: .htaccess (in Folder {FOLDER} on webgo its something like /home/www/flask_running_here ) ---
#.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ {FOLDER}/flask.cgi/$1 [L]
---- File:flask.cgi (in Folder {FOLDER} on webgo its something like /home/www/flask_running_here ) ---
#! /usr/bin/python3
@larsloQ
larsloQ / gist:6378335259ad7da2305921d46f9b6f1d
Last active February 23, 2022 15:16
Overwrite core blocks settings via block.json in gutenberg (wordpress > 5.8, block-api v2)
<?php
function yours59_filter_metadata_registration( $settings, $metadata ) {
/*
copied all block configuration files form gutenberg plugin (wp-content/plugins/gutenberg/build/block-library/blocks/**) to theme folder
so that I'm able to overwrite it from here, and do not loose changes every time gutenberg plugin updates
*/
$is_core_block = strpos( $metadata['name'], 'core/' );
if ( $is_core_block === 0 ) {
$name = substr( $metadata['name'], 5 );