Skip to content

Instantly share code, notes, and snippets.

View staabm's full-sized avatar
πŸ‘‹

Markus Staab staabm

πŸ‘‹
View GitHub Profile
@staabm
staabm / test.php
Last active August 16, 2023 08:53
hoa regex capturing groups
<?php
use PHPStan\ShouldNotHappenException;
use PHPStan\Type\Constant\ConstantArrayTypeBuilder;
require __DIR__ . '/vendor/autoload.php';
// 1. Read the grammar.
$grammar = new Hoa\File\Read('hoa://Library/Regex/Grammar.pp');
@staabm
staabm / test.php
Created September 2, 2022 15:17
slow phpstan analysis Bug #7901
<?php
namespace a\spaceX;
class MailAddressList
{
const MAIL_LIST = [
'a',
'b',
'c',
'd',
<?php
$queryString = '
SELECT
land.*,
COALESCE(NULLIF(landsprache.ort, ""), land.ort) AS ort
FROM land
INNER JOIN landsprache ON (land.landid=landsprache.landid and landsprache.spracheid = ?)
WHERE (webinaktiv = 0) ORDER BY COALESCE(NULLIF(landsprache.ort, ""), land.ort) ASC
@staabm
staabm / user-export.diff
Created June 1, 2020 07:00
redaxo example console command
$ git diff --staged
diff --git a/redaxo/src/addons/project/lib/user_export.php b/redaxo/src/addons/project/lib/user_export.php
new file mode 100644
index 000000000..26a85625e
--- /dev/null
+++ b/redaxo/src/addons/project/lib/user_export.php
@@ -0,0 +1,25 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
🌞 Morning 62 commits β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 36.5%
πŸŒ† Daytime 32 commits β–ˆβ–ˆβ–ˆβ–‰β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 18.8%
πŸŒƒ Evening 70 commits β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 41.2%
πŸŒ™ Night 6 commits β–‹β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 3.5%
@staabm
staabm / navigation_iterator.php
Last active July 30, 2020 14:07
redaxo navigation iterator
<?php
/**
* Klasse zum Erstellen von Navigationen, v0.1.
*
* benΓΆtigt PHP7!
*
* @package redaxo\structure
*/
@staabm
staabm / cd_catalog.xml
Last active September 7, 2016 08:03
test asset for php bug #73037
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body>
<CATALOG>
<CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
@staabm
staabm / FileSessionHandler.php
Last active February 12, 2023 20:20
Drop in replacement for the native php file session handler with lock-timeout support. Work arround PHP Bug #72345.
<?php
class FileSessionHandler implements SessionHandlerInterface
{
/**
* time in milliseconds how fast to poll the filesystem for a file-lock
* in case it cannot be acquired / is (b)locked by other resources.
*
* @var int
* @internal
<?php
<<<CONFIG
packages:
- "codeguy/arachnid: 1.*"
CONFIG;
set_time_limit(0);
$crawler = new \Arachnid\Crawler('https://www.example.com/', 5);
$crawler->traverse();
@staabm
staabm / jquery.validate.js
Created March 29, 2016 08:21
jq-validate input event
/*!
* jQuery Validation Plugin v1.15.1-pre
*
* http://jqueryvalidation.org/
*
* Copyright (c) 2016 JΓΆrn Zaefferer
* Released under the MIT license
*/
(function( factory ) {
if ( typeof define === "function" && define.amd ) {