This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Always answer in German | |
- Don’t apologize for errors: fix them. | |
- Comments MUST include purpose(s) | |
- If you can’t finish code, add #TODO: comments. | |
- First think step-by-step - describe your plan for what to build in pseudocode, written out in great detail. | |
- Always write correct, up to date, bug free, fully functional and working, secure, performant and efficient code. | |
- Favor clear and understandable code, addressing any performance trade-offs with reasoned explanations. | |
- Embed accessibility features, including ARIA roles and attributes, to make applications inclusive. Detail the purpose of each accessibility enhancement. | |
- Aim for clarity and efficiency in both code and explanations. Avoid unnecessary elaboration to keep solutions straightforward and understand | |
- Follow language-specific best practices and maintain consistent naming, structure, and formatting. Be adaptable to different organizational standards. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Dockerfile needs to be in folder /services/php | |
FROM php:fpm | |
RUN groupadd -g 1000 develop && \ | |
useradd -u 1000 -g 1000 -m develop | |
RUN apt-get update && \ | |
apt-get install -y zip libzip-dev libmagickwand-dev zlib1g-dev libpng-dev libjpeg-dev --no-install-recommends && \ | |
rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$formLayout = preg_replace(['/style=\\"[^\\"]*\\"/', '/\b(?:cf-btn)(?!-)\b/'], '', $formLayout); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
joomla: | |
image: joomla:latest | |
restart: unless-stopped | |
links: | |
- db:mysql | |
depends_on: | |
- db | |
healthcheck: | |
test: ['CMD-SHELL', 'mysqladmin ping -h localhost -u root -psecret'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
// Zeitraum in Sekunden, in dem die Anzahl der Versuche begrenzt wird | |
$limitPeriod = 3600; // 1 Stunde | |
// Maximale Anzahl erlaubter Versuche pro IP-Adresse und Fingerprint innerhalb des Zeitraums | |
$maxAttempts = 3; | |
// Generiere einen eindeutigen Fingerprint basierend auf IP-Adresse, User-Agent und Cookies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
// Zeitraum in Sekunden, in dem die Anzahl der Versuche begrenzt wird | |
$limitPeriod = 3600; // 1 Stunde | |
// Maximale Anzahl erlaubter Versuche pro IP-Adresse innerhalb des Zeitraums | |
$maxAttempts = 3; | |
// Eindeutiger Schlüssel für die IP-Adresse in der Session |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Source: http://goo.gl/qyLFbg | |
$html = '<img border="0" src="/images/image.jpg" alt="Image" width="100" height="100" />'; | |
preg_match( '@src="([^"]+)"@' , $html, $match ); | |
$src = array_pop($match); | |
// will return /images/image.jpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// easing functions http://goo.gl/5HLl8 | |
Math.easeInOutQuad = function (t, b, c, d) { | |
t /= d/2; | |
if (t < 1) { | |
return c/2*t*t + b | |
} | |
t--; | |
return -c/2 * (t*(t-2) - 1) + b; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class JoomlaHelper{ | |
/** | |
* Obtiene la versión de Joomla (3,4, ...) | |
* | |
* @return string Versión mayor de Joomla | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Arrow Function": { | |
"prefix": "arrow", | |
"body": ["const $1 = () => {", "$0", "}"], | |
"description": "Arrow Function" | |
}, | |
"Fetch": { | |
"prefix": "fetch", | |
"body": [ | |
"try {", |
NewerOlder