Skip to content

Instantly share code, notes, and snippets.

View Gonzalo2683's full-sized avatar
🎯
Focusing

Gonzalo Guevara Gonzalo2683

🎯
Focusing
View GitHub Profile
@Gonzalo2683
Gonzalo2683 / setup.md
Last active June 12, 2020 15:54
[PhpStorm UnitTest Ddev Docker] PhpUnit con Docker #PhpStorm

Configuration

Test framework

  1. Go to Languages && Frameworks > PHP > Test Frameworks

  2. Click + button and select PhpUnit by Remote Interpreter

  3. Si no tienes alguno de ddev creado, click el en botón con tres puntos "..." y se debe crear uno sobre service web Ddev, caso contrario selecciona el interprete basado en el servicio web de Ddev. click Aceptar

@Gonzalo2683
Gonzalo2683 / utils.php
Created June 2, 2020 03:45
[Php Utils] Funciones útiles #php
<?php
/*
Check if a string has accents
*/
function has_accent(string $string) {
$result = FALSE;
if (preg_match('/[\x80-\xff]/', $email)) {
$result = TRUE;
}
return $result;
@Gonzalo2683
Gonzalo2683 / ssh_utils.md
Last active May 25, 2020 13:53
[SSH Utils] Comandos SSH

Permisos

chmod 775 file.php // solo owner puede escribir y leer

Mover directorio

Copia todo el contenido de una carpeta hacia otra

mv -v drupal-8.7.7/* .  
@Gonzalo2683
Gonzalo2683 / drupal_console.md
Created May 25, 2020 13:45
[Drupal Console Utils]

Mode dev

Dev

drupal site:mode dev

Prod

drupal site:mode prod
@Gonzalo2683
Gonzalo2683 / composer_utils.md
Last active July 12, 2020 07:47
[Composer utils] Comandos útiles de composer #composer #Drupal

gh

@Gonzalo2683
Gonzalo2683 / drupal_utils.md
Last active July 12, 2020 07:31
[Drupal Utils] Funciones útiles de drupal 8 #Drupal

Hook Update

Config





@Gonzalo2683
Gonzalo2683 / atajos.md
Last active May 30, 2020 03:48
[JetBrains Shorcuts - Linux] Atajos útiles para el IDE #PhpStorm

Búsqueda

Ctrl + E

Muestra la búsqueda de los archivos abiertos

Ctrl + Shift + E

Muestra las búsquedas recientes.

Ctrl + Shift + A

Muestra la busqueda de acciones

@Gonzalo2683
Gonzalo2683 / README.md
Last active May 15, 2020 06:17 — forked from juampynr/README.md
[Redirect to node after save] Make Drupal not to redirect to the node display after saving it #Drupal

Drupal's default behavior is to redirect the user to the full display of a node after it has been saved.

If you want to stay in the edit form after saving, add this snippet to a custom module adjusting the module namespace in the two functions.

Acknowledgements

@Gonzalo2683
Gonzalo2683 / script.sh
Last active May 15, 2020 06:19 — forked from tonylukasavage/script.sh
[Git stash] Move all uncommitted changes to a new branch and revert the existing branch to HEAD."master" has uncommitted changes. You decided you'd rather make those changes in "dev_branch". Here's how to move those uncommitted changes to "dev_branch" and then revert "master" to its last commit. #Git
# get into the master branch
git checkout master
# create a new branch for the changes and check it out
git checkout -b dev_branch
# stash the changes until we revert master
git stash
# go back to master
Falsy Values (using !!)
The empty string ""
null
undefined
The number 0
The number NaN
The Boolean false
Truthy
The String "0", " ", "false"