Skip to content

Instantly share code, notes, and snippets.

@leobm
leobm / istspahnnochimamt-widget.js
Created August 6, 2025 07:48
www.istspahnnochimamt.de mini Widget für die eigenen Webseite
(function() {
const e = document.createElement("style");
e.textContent = `.spahn-widget{background-color:#7c86ff;color:#fff;font-family:-apple-system,BlinkMacSystemFont,'SegoeUI',Roboto,Oxygen,Ubuntu,sans-serif;max-width:600px;padding:2rem;margin:1rem
auto;text-align:center;border-radius:8px}.spahn-widget h1{font-size:4rem}.spahn-widget .answer{font-size:3rem;font-weight:bold;margin-bottom:1rem}.spahn-widget .description{font-size:1.5rem;line-height:1.4}`;
document.head.appendChild(e);
const t = document.createElement("div");
t.className = "spahn-widget", t.innerHTML = `<h1>Ist Spahn noch im Amt?</h1><div class="answer" id="spahn-answer">Lade...</div><div class="description" id="spahn-description"></div>`, document.body.appendChild(t), fetch("https://istspahnnochimamt.de/api/v1/inOffice").then(e => e.json()).then(e => {
document.getElementById("spahn-answer").textContent = e.isSpahnStillInOffice ? "Leider ja" : "Endlich Nein 🥳", document.getElementById("spahn-description").innerHTM
@passatgt
passatgt / eu-vat-validate-regex.php
Created April 7, 2025 19:37
Regex to validate EU vat numbers
<?php
$vat_number = 'HU12345678';
if(!preg_match('/^((AT)?U[0-9]{8}|(BE)?[0-9]{10}|(BG)?[0-9]{9,10}|(CY)?[0-9]{8}[A-Z]|(CZ)?[0-9]{8,10}|(DE)?[0-9]{9}|(DK)?[0-9]{8}|(EE)?[0-9]{9}|(EL|GR)?[0-9]{9}|(ES)?[0-9A-Z][0-9]{7}[0-9A-Z]|(FI)?[0-9]{8}|(FR)?[0-9A-Z]{2}[0-9]{9}|(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})|(HU)?[0-9]{8}|(IE)?[0-9]S[0-9]{5}[A-Z]|(IT)?[0-9]{11}|(LT)?([0-9]{9}|[0-9]{12})|(LU)?[0-9]{8}|(LV)?[0-9]{11}|(MT)?[0-9]{8}|(NL)?[0-9]{9}B[0-9]{2}|(PL)?[0-9]{10}|(PT)?[0-9]{9}|(RO)?[0-9]{2,10}|(SE)?[0-9]{12}|(SI)?[0-9]{8}|(SK)?[0-9]{10})$/', $vat_number)) {
return array(
"valid" => false
);
}
// ==UserScript==
// @name TweetXer
// @namespace https://github.com/lucahammer/tweetXer/
// @version 0.9.3
// @description Delete all your Tweets for free.
// @author Luca,dbort,pReya,Micolithe,STrRedWolf
// @license NoHarm-draft
// @match https://x.com/*
// @match https://mobile.x.com/*
// @match https://twitter.com/*
@BugBuster1701
BugBuster1701 / mig480.php
Last active March 11, 2020 10:55
Contao 4.8.0 DB Migration wichtiger Teil eines Bildes
<?php
//ich muss ins web/ Verzeichnis, Aufruf über Browser oder Kommandozeile
//vorher DB Backup durchführen der tl_files Tabelle zur Sicherheit
define('TL_SCRIPT', 'MIGRATION480');
define('TL_MODE' , 'FE');
include __DIR__.'/../system/initialize.php';
<?php
die ('This is not executable now! Please comment out this line.');
$config = array(
'url' => 'https://getcomposer.org/composer.phar',
'dir' => __DIR__ . '/composer',
'bin' => __DIR__ . '/composer/composer.phar',
'json' => __DIR__ . '/composer/composer.json',
'command' => 'install' // The composer command update/install
@discordier
discordier / endlessscroll.js
Created March 22, 2017 22:11
Endless scrolling for MetaModels content elements.
jQuery(document).ready(function () {
var j= jQuery,
container = '.ce_metamodel_content',
list = '.layout_full',
entry = '.item',
pagination = j('.pagination');
var urls = [],
scrolled = function (elem) {
var
@RavuAlHemio
RavuAlHemio / contao3.conf
Last active July 21, 2017 21:51
Contao 3 and 4 nginx.conf
index index.php index.html;
location ~ ^/(favicon\.ico|robots\.txt)$ {
allow all;
log_not_found off;
access_log off;
}
# don't show templates
location ~* \.(tpl|html5|xhtml)$ {
@fiedsch
fiedsch / Contao backup script
Last active October 20, 2018 16:42
Contao Backup
moved to repository https://github.com/fiedsch/contao-backup-script
see also https://github.com/fiedsch/contao-4-backup-script (for Contao 4)
@stefansl
stefansl / contao-db-update.php
Last active October 17, 2019 21:01
Modified path upgrade script for contao. No config editing necessary. Copy in your Contao root and run.
<?php
/*
When updating from Contao 2 to Contao 3, you must not rename the tl_files folder to files!
If you want to re­name the folder, you have to take the following steps:
· Complete the version 3 update in the install tool
· Then rename the upload folder in the back end settings to files
· Last run the modified version of Tristan's script
@psi-4ward
psi-4ward / contao.conf
Last active October 19, 2016 10:44
NGINX Contao 3 Config with PHP-FPM
index index.php index.html index.html;
client_max_body_size 200M;
sendfile on;
error_page 404 /404.html;
location / {
try_files $uri $uri/ /index.php?$args;
}
location = /favicon.ico {