This file contains 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 | |
/** | |
* Create images with timeline ImageStyle. | |
*/ | |
protected function createImages() { | |
$style = ImageStyle::load('timeline'); | |
$style_extra = ImageStyle::load('timeline_extra'); | |
$nodes = $this->getNodes(); | |
foreach ($nodes as $node) { |
This file contains 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
docker run -it -p 127.0.0.1:8983:8983 -t 36_web:latest bash |
This file contains 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 | |
/* | |
+----------------------------------------------------------------------+ | |
| APC | | |
+----------------------------------------------------------------------+ | |
| Copyright (c) 2006-2011 The PHP Group | | |
+----------------------------------------------------------------------+ | |
| This source file is subject to version 3.01 of the PHP license, | | |
| that is bundled with this package in the file LICENSE, and is | | |
| available through the world-wide-web at the following url: | |
This file contains 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
{% block version -%} | |
vcl 4.0; | |
{% endblock %} | |
# This Varnish VCL has been adapted from the Four Kitchens VCL for Varnish 3. | |
# Default backend definition. Points to Apache, normally. | |
backend default { | |
{% block backend -%} | |
.host = "{{ varnish_default_backend_host }}"; |
This file contains 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
#!/bin/bash | |
# RAM consumed in MB per connection | |
ps -ylC apache2 --sort:rss | awk '{SUM += $8; I += 1} END {print SUM/I/1024}' | |
# System consumed in MB. | |
ps -N -ylC apache2 --sort:rss | awk '{SUM += $8} END {print SUM/1024}' | |
(RAMTOTAL – RAM_RESTOPROCESOS) / RAM_POR_CONEXIÓN |
This file contains 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
aptitude install optipng jpegoptim | |
optipng *.png | |
jpegoptim *.jpg |
This file contains 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
#!/bin/bash | |
cd drupal | |
sudo rm -fr vendor | |
composer install | |
sudo chmod 777 sites/default | |
cd sites/default | |
rm -fr settings.php services.yml | |
# for developers only (sets up some dev mode settings, do this before install!) | |
cp ../example.settings.local.php ./settings.local.php | |
# for everyone |
This file contains 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 | |
namespace Drupal\view_mode_page\Controller; | |
use Drupal\Core\Controller\ControllerBase; | |
use Drupal\Core\Routing\AccessAwareRouterInterface; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Symfony\Component\HttpFoundation\RequestStack; | |
use Symfony\Component\HttpKernel\HttpKernelInterface; |
This file contains 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 | |
// $id = some node ID | |
// $field = field name for entity reference field | |
$node = Node::load($id); | |
/** @var \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem $referenceItem */ | |
$referenceItem = $node->get($field)->first(); | |
/** @var \Drupal\Core\Entity\Plugin\DataType\EntityReference $entityReference */ | |
$entityReference = $referenceItem->get('entity'); |
This file contains 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 | |
# KO memcache: http://cgit.drupalcode.org/memcache/tree/README.txt?h=8.x-2.x | |
//$settings['memcache']['servers'] = ['memcached:11211' => 'default']; | |
//$settings['memcache']['bins'] = ['default' => 'default']; | |
//$settings['memcache']['key_prefix'] = ''; | |
/** | |
* Memcache Configuration. | |
*/ | |
/* |