This file contains hidden or 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
Backup specifc database | |
docker exec -i database pg_dump --u postgres DATABASE_NAME_HERE > DUMP_`date +%d-%m-%Y"_"%H_%M_%S`.sql | |
Backup all databases | |
docker exec -t -u postgres CONTAINER_NAME_HERE pg_dumpall -c > DUMP_`date +%d-%m-%Y"_"%H_%M_%S`.sql | |
to restore: | |
cat YOUR_FILE.sql | docker exec -i CONTAINER_NAME_HERE psql -U USER_NAME_HERE -d DATABASE_NAME_HERE |
This file contains hidden or 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 declare(strict_types=1); | |
require __DIR__ . '/../vendor/autoload.php'; | |
function run_command(string $command): void { | |
$loop = React\EventLoop\Factory::create(); | |
$process = new React\ChildProcess\Process($command); | |
$process->start($loop); | |
$process->on('exit', function ($exitCode) use ($command) { | |
// Trigger alerts that the command finished. |
This file contains hidden or 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
<template> | |
<h1>Página secreta!</h1> | |
</template> |
This file contains hidden or 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
<link rel="preload" href="css/global.min.css" as="style" onload="this.rel='stylesheet'"> | |
<noscript><link rel="stylesheet" href="css/global.min.css"></noscript> | |
<script> | |
/*! loadCSS. [c]2017 Filament Group, Inc. MIT License */ | |
!function(a){"use strict";var b=function(b,c,d){function j(a){if(e.body)return a();setTimeout(function(){j(a)})}function l(){f.addEventListener&&f.removeEventListener("load",l),f.media=d||"all"}var g,e=a.document,f=e.createElement("link");if(c)g=c;else{var h=(e.body||e.getElementsByTagName("head")[0]).childNodes;g=h[h.length-1]}var i=e.styleSheets;f.rel="stylesheet",f.href=b,f.media="only x",j(function(){g.parentNode.insertBefore(f,c?g:g.nextSibling)});var k=function(a){for(var b=f.href,c=i.length;c--;)if(i[c].href===b)return a();setTimeout(function(){k(a)})};return f.addEventListener&&f.addEventListener("load",l),f.onloadcssdefined=k,k(l),f};"undefined"!=typeof exports?exports.loadCSS=b:a.loadCSS=b}("undefined"!=typeof global?global:this); | |
/*! loadCSS rel=preload po |
This file contains hidden or 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
// Documented by Stoyan Stefanov: https://www.facebook.com/note.php?note_id=10151176218703920 | |
(function() { | |
var url = 'http://example.org/js.js'; | |
var iframe = document.createElement('iframe'); | |
(iframe.frameElement || iframe).style.cssText = | |
"width: 0; height: 0; border: 0"; | |
iframe.src = "javascript:false"; | |
var where = document.getElementsByTagName('script')[0]; | |
where.parentNode.insertBefore(iframe, where); | |
var doc = iframe.contentWindow.document; |
This file contains hidden or 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 | |
use Drupal\Core\Form\FormStateInterface; | |
function example_ajax_form_alter() { | |
$ajax_form_request = \Drupal::request()->query->has(FormBuilderInterface::AJAX_FORM_REQUEST); | |
if ($ajax_form_request) { | |
if (!$form_state->isProcessingInput()) { | |
\Drupal::logger('example')->notice('first pass'); | |
} |
This file contains hidden or 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
public function waitForAjax() | |
{ | |
$waitTime = 10000; | |
try { | |
//Wait for Angular | |
$angularIsNotUndefined = $this->getSession()->evaluateScript("return (typeof angular != 'undefined')"); | |
if ($angularIsNotUndefined) { | |
//If you run the below code on a page ending in #, the page reloads. | |
if (substr($this->getSession()->getCurrentUrl(), -1) !== '#') { | |
$angular = 'angular.getTestability(document.body).whenStable(function() { |
This file contains hidden or 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
gunzip -c database.sql.gz | drush sqlc |
This file contains hidden or 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 | |
/** | |
* @author Gildas Quéméner <[email protected]> | |
* @copyright 2013 Akeneo SAS (http://www.akeneo.com) | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
*/ | |
use Behat\Behat\Exception\BehaviorException; | |
use Behat\Mink\Driver\Selenium2Driver; |

NewerOlder