mysqldump -d --skip-triggers --skip-events --skip-routines {database} > structure.sql
mysqldump -t --fields-enclosed-by='"' --fields-escaped-by='\' --fields-terminated-by='\n' --lines-terminated-by='\n' --tab {absoluteTargetDir} {database}
{# | |
Pagination template code to create a pagination with a maximum number of links | |
plus first and last link and more and less indicators. | |
Adjust the page link/button markup to fit your needs. This would create a paginations like the following: | |
_1_ 2 3 | |
1 2 _3_ 4 5 6 | |
1 2 _3_ 5 6 ... 7 | |
1 ... 5 6 _7_ 8 9 ... 13 |
// Sometimes it is helpful/necessary to create a promise, that delays the execution. | |
// This snippet returns a promise, that is resolved after a given timeout. | |
// The `min` and `max` arguments are used to calcuate a random delay in the range between `min` and `max` | |
let delay = (min, max) => { | |
return new Promise(resolve => { | |
setTimeout(resolve, Math.random() * (max - min) + min) | |
}) | |
} | |
// In your actual code you use it as follows: |
#!/bin/sh | |
# This script is meant to be user with docker images from https://hub.docker.com/r/webcoastdk/composer/tags | |
# | |
# It mounts the current working directory into /build in the container and calls the given command. | |
# Additionally the current users `.ssh` and `.composer` directory are also mounted to give access to composer cache | |
# and SSH known hosts | |
# | |
# On hosts with MacOS the SSH agent is started inside the container, as it is currently not possible to mount the SSH | |
# authentication agent socket into the container. | |
# On other hosts (mainly Linux) the current `$SSH_AUTH_SOCK` is mounted to `/ssh-agent` and the environment variable |
#!/usr/bin/env bash | |
# Takes stdin as message and prepends timestamp and severity and writes it into the given log file | |
function log() { | |
file=$1 | |
severity=$2 | |
while read text | |
do | |
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S") | |
touch $file |
<?php | |
$dbConfig = [ | |
'host' => 'localhost', | |
'database' => '', | |
'user' => '', | |
'password' => '' | |
]; | |
if (file_exists($_SERVER['HOME'] . '/.my.cnf')) { | |
// If `.my.cnf` exists in PHP home directory, parse it with sections |
# Copy this file into to playbook or your role's tasks directory | |
# and include it with | |
# - name: Generate SSH key pair for root {your-user-name-here} | |
# include_tasks: ./ssh_key_pair.yaml | |
# vars: | |
# user: {your-user-name-here} | |
# type: {ssh-key-type} # defaults to `rsa` | |
# | |
# Arguments: | |
# - user: The user name you want to generate a key pair for (required) |
################################################################################### | |
### WARNING: This query uses recursion. This requires MySQL 8+ or MariaDB 10.2+ ### | |
################################################################################### | |
# Find the used backend layout for each page, including next level layout from parent pages | |
WITH RECURSIVE Layout AS ( | |
SELECT | |
uid, | |
pid, | |
slug, |
<?php | |
declare(strict_types=1); | |
namespace YourVendor\YourPackage\Form; | |
use TYPO3\CMS\Form\Domain\Model\Renderable\AbstractRenderable; | |
use TYPO3\CMS\Form\Domain\Model\Renderable\RenderableInterface; | |
use TYPO3\CMS\Form\Domain\Runtime\FormRuntime; |