###Sketch trial non stop
Open hosts files:
$ open /private/etc/hosts
Edit the file adding:
127.0.0.1 backend.bohemiancoding.com
127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com
###Sketch trial non stop
Open hosts files:
$ open /private/etc/hosts
Edit the file adding:
127.0.0.1 backend.bohemiancoding.com
127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com
<?php | |
namespace Drupal\yourmodule\Controller; | |
use Drupal\Core\Controller\ControllerBase; | |
use Symfony\Component\HttpFoundation\RedirectResponse; | |
/** | |
* A controller that redirects to the current user's edit account page. |
The topic of interest in the "function slice and aggregate...." It solves the problem of plotting {timestamp, value} points, not just adding a new value.
It originates from polling a public api that exposes recorded IoT data. The data received contains the latest value for the inquired sensors, however since the data is timestamped, these should be respected in the plotting.
Notice: The context stores the obtained dataset and adds points if the timestamp is not previously seen. Some memory is wasted maintaining a lookup array that is not used for anything.
<?php | |
$referenced_files = $node->get('your_field')->referencedEntities(); | |
$vars['download_article'] = file_create_url($referenced_files[0]->uri->value); |
Please note I created that sheet as a personal side note/draft and not everything is fully tested. There could be errors or better things to do. So if you spot something wrong or something that can be improved, feel free to comment below and I will do the changes.
Image path: {{ file_url(content.field_name['#items'].entity.uri.value) }}
{# | |
.theme: | |
function birch_preprocess_image_widget(&$variables, $hook) { | |
// the image widget needs to know what the label is | |
// look in admin/image-widget.hmtl.twig | |
$variables['form_label_id'] = $variables['element']['#id']; | |
} | |
#} | |
{# |
<?php | |
use Drupal\image\Entity\ImageStyle; | |
/** | |
* Implements hook_preprocess_HOOK() for paragraph--para-slide.html.twig. | |
*/ | |
function themename_preprocess_paragraph__para_slide(&$variables) { | |
$paragraph = $variables['paragraph']; | |
if (!$paragraph->field_image->isEmpty()) { |
$parameters = new MenuTreeParameters(); | |
$parameters->setMaxDepth(2)->onlyEnabledLinks(); | |
$menuTreeService = Drupal::menuTree(); | |
$tree = $menuTreeService->load('main', $parameters); | |
if ($tree) { | |
$build = $menuTreeService->build($tree); |
<?php | |
/** | |
* Implements template_preprocess_paragraph(). | |
*/ | |
function TEMPLATE_preprocess_paragraph(&$variables) { | |
$paragraph = $variables['paragraph']; | |
$bundle = $paragraph->bundle(); | |
if ($bundle == 'mybundle') { | |
// do stuff |
//in dollartheme.theme where dollartheme is your theme name | |
function dollartheme_preprocess_node(array &$variables) { | |
$node = $variables['node']; | |
$variables['abs_url'] = $node->url('canonical', array( | |
'language' => $node->language(), | |
'absolute' => TRUE, | |
)); | |