Skip to content

Instantly share code, notes, and snippets.

View PSF1's full-sized avatar
☀️
Focusing

Pedro Peláez PSF1

☀️
Focusing
View GitHub Profile
@PSF1
PSF1 / lxc_ram.start.sh
Created December 18, 2018 14:43
Run LXC in RAM completely
#!/bin/bash
machinename="ubuntu"
# Help menu
print_help() {
cat <<-HELP
First, copy both .sh files to the LXC machine folder, next edit and configure the machine name in each.
@PSF1
PSF1 / uri-tools.js
Created April 26, 2018 14:07
Javascript URL tools.
/**
* Tiny function for basic query string parsing.
*
* @see https://davidwalsh.name/query-string-javascript
*
* @param name
* Parameter name.
* @param url
* Url where search.
*
<?php
$query = \Drupal::entityQuery('cub');
$result = $query->execute();
$entidadesIDs = array_values($result);
// object $entidad con todas los registros guardasdos de cub
$entidades = entity_load_multiple('cub', $entidadesIDs);
?>
/**
* Alter the Views data for a single Field API field.
*
* Implements hook_field_views_data_alter().
*
* @see https://www.drupal.org/project/drupal/issues/2851325
*/
function turismo_customization_field_views_data_alter(array &$data, FieldStorageConfigInterface $field_storage) {
// $data = views_field_default_views_data($field_storage);