Skip to content

Instantly share code, notes, and snippets.

View michitheonlyone's full-sized avatar
🏠
Working from home

Michael Ihde michitheonlyone

🏠
Working from home
View GitHub Profile
@michitheonlyone
michitheonlyone / signaturepad.html.twig
Last active June 18, 2024 03:10
Signature Pad for Symfony Forms (it can be used in any website to create digital signatures with a pen on touchscreen
{#
Signature Pad for Symfony Forms
© 2024 by Michael Ihde wemida.com
https://github.com/wemida
Variables to use with include:
{% include with ... %} => see below example
{{ sig_title ?? 'E-Signature' }}
{{ sig_info_text ?? 'Sign in the canvas below and save your signature as an image!' }}
{{ sig_canvas_id ?? 'sig-canvas' }}
@michitheonlyone
michitheonlyone / rating.html
Created June 15, 2024 21:21
Star Rating HTML
<tr>
<!--<td style="width: 100%">-->
<td>
<b>Fragetitel</b>
<br />Description frage beschreibung
</td>
<td>
<input type="hidden" value="" name="emoji-rating" id="emoji-rating" />
<div class="btn-group">
<button type="button" class="btn btn-outline-secondary btnrating" data-attr="1" id="rating-star-1">
@michitheonlyone
michitheonlyone / wichtigste-html-elemente.html
Last active May 25, 2024 22:56
Diese HTML Elemente sind die wichtigsten
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Beispieldokument mit den wichtigsten HTML-Tags">
<title>Wichtige HTML-Tags</title>
<link rel="stylesheet" href="styles.css">
<style>
@michitheonlyone
michitheonlyone / cd-php-cli-with-xdebug.bash
Created August 3, 2023 11:52
Run PHP from the comandline terminal (cmd) with xdebug enabled for listener in php storm
php -dxdebug.mode=debug -dxdebug.client_host=127.0.0.1 -dxdebug.client_port=9003 -dxdebug.start_with_request=yes bin/console
function asyncFuncWithPromise(): Promise<string> {
return new Promise((resolve) => {
setTimeout(() => {
resolve('asyncFuncWithPromise :: resolved after 1 second');
}, 1000);
});
}
async function asyncFuncWithAwait(): Promise<string> {
await asyncFuncWithPromise();
@michitheonlyone
michitheonlyone / ClassNameInArrayOfClasses.php
Created July 7, 2023 10:39
The solution to find if a class exists in a array of classes
<?php declare(strict_types=1);
class A {}
class B {}
class C {}
$classes = [
new A(),
new B(),
];
@michitheonlyone
michitheonlyone / case-types.txt
Last active February 9, 2023 12:20
Snake Case, Pascal Case, Camel Case, Kebab Case and other Case Types for programming
camelCase
PascalCase
snake_case
UPPER_SNAKE_CASE
kebab-case (dash-case)
UPPER-KEBAB-CASE
dot.case
UPPER.DOT.CASE
unicorncase
UPPERUNICORNCASE (TROLLCASE)
@michitheonlyone
michitheonlyone / web.config
Last active December 6, 2022 11:06
IIS web.config for Symfony and other webapps. RewriteRule to index.php
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
@michitheonlyone
michitheonlyone / XMLReader.php
Created August 19, 2022 13:26
PHP XMLReader - Composed of SimpleXMLElement to convert XML to Array - do not use for large xml!
<?php declare(strict_types=1);
namespace App\Util;
final class XMLReader
{
private \SimpleXMLElement $XMLElement;
/**
* @param string $xmlString A well-formed XML string of any resource
@michitheonlyone
michitheonlyone / PHP8_DependencyInjection.php
Last active January 28, 2022 10:44
PHP 8 new Dependency Injection vs PHP 7.4
<?php declare(strict_types=1);
// PHP 8
final class DependencyInjectionExampleNew
{
public function __construct(private string $var) {}
}
// PHP 7.4
final class DependencyInjectionExample