Skip to content

Instantly share code, notes, and snippets.

View W4U-TOURS's full-sized avatar

W4U W4U-TOURS

View GitHub Profile
@W4U-TOURS
W4U-TOURS / common_linux_commands.sh
Created September 3, 2022 14:29 — forked from nelsestu/common_linux_commands.sh
Common Linux Commands bundled into a syntax friendly file
================================================================================
Terminal hotkeys ===============================================================
Ctrl+U # cut all before cursor
Ctrl+K # cut all after cursor
Ctrl+W # cut word before cursor
Ctrl+Y # paste
Ctrl+L # clear screen
Ctrl+S # freeze output
@W4U-TOURS
W4U-TOURS / Tools.php
Created July 2, 2021 07:13 — forked from kpodemski/Tools.php
Handling guests user in Token::getToken() in PrestaShop
<?php
public static function getToken($page = true, Context $context = null)
{
if (!$context) {
$context = Context::getContext();
}
if (!Validate::isLoadedObject($context->customer)) {
$unique = $context->cookie->id_guest;
} else {
$unique = $context->customer->id.$context->customer->passwd;
@W4U-TOURS
W4U-TOURS / piwik-nginx.conf
Created December 22, 2017 16:30 — forked from xenithorb/piwik-nginx.conf
Piwik flat-file nginx configuration
#-*- mode: nginx; mode: flyspell-prog; mode: autopair; ispell-local-dictionary: "american" -*-
## Define a zone for limiting the number of simultaneous
## connections nginx accepts. 1m means 32000 simultaneous
## sessions. We need to define for each server the limit_conn
## value refering to this or other zones.
## ** This syntax requires nginx version >=
## ** 1.1.8. Cf. http://nginx.org/en/CHANGES. If using an older
## ** version then use the limit_zone directive below
## ** instead. Comment out this
## ** one if not using nginx version >= 1.1.8.
@W4U-TOURS
W4U-TOURS / seed_derivatives.drush.inc
Created November 23, 2017 10:32 — forked from jimconte/seed_derivatives.drush.inc
This script can generate image derivatives for Drupal for warming up the filesystem prior to going live. Image derivative generation puts an amount of load on the servers so it images have been migrated from another server with no derivatives, it may be useful to pre-generate using this script.
<?php
use Drupal\Core\Database\Database;
use Drupal\Core\Database\Query\Condition;
use Drupal\image\Entity\ImageStyle;
use Drupal\file\Entity\File;
/**
* ================================================================
* Implements hook_drush_command().
* ----------------------------------------------------------------
@W4U-TOURS
W4U-TOURS / seed_derivatives.drush.inc
Created November 23, 2017 10:32 — forked from typhonius/seed_derivatives.drush.inc
This script can generate image derivatives for Drupal for warming up the filesystem prior to going live. Image derivative generation puts an amount of load on the servers so it images have been migrated from another server with no derivatives, it may be useful to pre-generate using this script.
<?php
/**
* Implements hook_drush_command().
*/
function seed_derivatives_drush_command() {
$items = array();
$items['seed_derivatives'] = array(
'description' => "Create image derivatives",