Skip to content

Instantly share code, notes, and snippets.

@keopx
keopx / settings.local.php
Last active August 28, 2024 06:24
Drupal 8 Redis settings.local.php
<?php
/**
* Set redis configuration.
*/
/** @see: https://docs.platform.sh/frameworks/drupal8/redis.html */
if (extension_loaded('redis')) {
// Set Redis as the default backend for any cache bin not otherwise specified.
// $settings['cache']['default'] = 'cache.backend.redis';
@w00fz
w00fz / sphp.sh
Last active November 28, 2024 12:37
PHP switcher
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
#!/usr/bin/awk
BEGIN {
for (i = 0; i <= 255; i++) {
ord[sprintf("%c", i)] = i
}
}
function escape(str, c, len, res) {
len = length(str)