Skip to content

Instantly share code, notes, and snippets.

AuthName "Protected Area"
AuthType Basic
AuthUserFile /path/to/your/.htpasswd
AuthGroupFile /dev/null
SetEnvIf Request_URI .* noauth
SetEnvIf Request_URI the_uri_you_want_to_protect !noauth
SetEnvIf Request_URI /another/uri/ !noauth
SetEnvIf Request_URI add_as_many_as_you_want !noauth
@Digi92
Digi92 / git
Last active September 28, 2022 15:21
Just replace `<AUTHORNAME>` with the person name you want to see
git log --author="<AUTHORNAME>" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }'
@Digi92
Digi92 / CorsSubscriber.php
Last active December 18, 2023 22:58
Adds CORS (Cross-Origin Resource Sharing) headers support in your Symfony application. This event subscriber is used to handle CORS Preflight OPTIONS requests. It enables the application to accept requests from the domain specified in 'app.frontend_
<?php
declare(strict_types=1);
namespace App\Subscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
@Digi92
Digi92 / renew_ssl_cert.yaml
Last active May 6, 2024 21:50 — forked from TJ-developer/renew_ssl_cert.yaml
Homeassistant Blueprint for SSL-Certificate renewal
blueprint:
name: Renew Let's Encrypt Certificate
description: Renew Certificate when due date is below given value
domain: automation
input:
cert_expiry_sensor:
name: Certificate Expiry Sensor
description: Sensor from the Certificate Expiry Integration (https://www.home-assistant.io/integrations/cert_expiry)
selector:
entity:
blueprint:
name: Low Battery Notifications & Actions
description: >
# 🪫 Low Battery Notifications & Actions
**Version: 2.1**
🚀 Stay Charged, Stay Smart! Let's automate and take charge of your battery maintenance!🔋⚡