Skip to content

Instantly share code, notes, and snippets.

@tobybellwood
tobybellwood / image_replacement.md
Last active February 1, 2022 13:36
lagoon-images reference

The following is a table to indicate how users of the current amazeeio-namespaced Lagoon images can upgrade seamlessly to the new uselagoon-namespaced ones.

This brings with it a number of improvements:

  • Versioning is now available for a number of images that previously were susceptible to major version increments (mariadb, postgres, redis, varnish), ensuring more predictability
  • ARM (Apple Silicon) compatibility is only available in uselagoon-namespaced & versioned images
  • Automated updates via GitHub/Dependabot, RenovateBot etc are much easier under the new versioning system

For more information see the blog series at https://dev.to/uselagoon/moving-lagoon-to-semantic-versioned-docker-images-57d0

To use the table below - find the image you currently use in the "Old Image" column, and replace it with the "New Image" in your Dockerfile/docker-compose.yml

@ozin7
ozin7 / Controller.php
Last active March 7, 2024 17:56
Drupal 8: Dependency injection in Service, Controller, Plugin, Deriver.
<?php
/**
* Controller. Implements ContainerInjectionInterface
*/
namespace Drupal\gurei\Controller;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\gurei\Service\CompanyService;
use Symfony\Component\DependencyInjection\ContainerInterface;
@WengerK
WengerK / README.md
Last active March 27, 2024 10:38
Debug Drupal - KernelTest, BrowserTest & JavascriptTest

Debug Drupal - KernelTest, BrowserTest & JavascriptTest

Debugging tests can often be a pain, but using those snippets it's possible to get a lot of informations when using BrowserTestBase or JavascriptTestBase.

Get HTML of a page

Sometimes you'll want to inspect the HTML of the page or a specific element. There is no official method for this yet but the following works:

$this->assertEquals('', $this->getSession()->getPage()->getHTML());
@leymannx
leymannx / ionos.sh
Last active May 21, 2024 10:48
1&1 ionos shared webhosting command line PHP Drush Composer Drupal
# https://www.ionos.com/community/hosting/php/using-php-composer-in-11-ionos-webhosting-packages/
php -v
# PHP 4.4.9 (cgi-fcgi) (built: Nov 7 2018 13:27:00)
# Copyright (c) 1997-2008 The PHP Group
# Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
/usr/bin/php7.1-cli -v
# PHP 7.1.25 (cli) (built: Dec 10 2018 10:11:36) ( NTS )
# Copyright (c) 1997-2018 The PHP Group
@elistone
elistone / Drupal-IE-scss-Mixin.md
Last active April 27, 2016 15:22
Drupal If IE scss mixin
@gilbitron
gilbitron / .env.travis
Last active August 12, 2023 08:06
Laravel 5 Travis CI config
APP_ENV=testing
APP_KEY=SomeRandomString
DB_CONNECTION=testing
DB_TEST_USERNAME=root
DB_TEST_PASSWORD=
CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync
@amnuts
amnuts / phpstorm.bat
Last active June 22, 2021 17:04
Add context menu to Windows 7 to open file/folder in PhpStorm
@echo off
SET PhpStormPath=C:\Program Files (x86)\JetBrains\PhpStorm 8.0.2\bin\PhpStorm64.exe
echo Adding file entries
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in PhpStorm" /t REG_SZ /v "" /d "Open in PhpStorm" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in PhpStorm" /t REG_EXPAND_SZ /v "Icon" /d "%PhpStormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in PhpStorm\command" /t REG_SZ /v "" /d "%PhpStormPath% \"%%1\"" /f
echo Adding folder entries
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@natelandau
natelandau / .bash_profile
Last active July 24, 2024 15:28
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@jpatters
jpatters / HeidiDecode.js
Last active May 17, 2024 12:41
Decodes a password from HeidiSQL. HeidiSQL passwords can be found in the registry. Use File -> Export Settings to dump all settings. Great for if you forget a password.
function heidiDecode(hex) {
var str = '';
var shift = parseInt(hex.substr(-1));
hex = hex.substr(0, hex.length - 1);
for (var i = 0; i < hex.length; i += 2)
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16) - shift);
return str;
}
document.write(heidiDecode('755A5A585C3D8141786B3C385E3A393'));