Skip to content

Instantly share code, notes, and snippets.

View abelperezlindo's full-sized avatar
🏠
Working from home

abelpzl abelperezlindo

🏠
Working from home
  • Argentina
View GitHub Profile
@davidjguru
davidjguru / intro_drupal_8_9_getting_taxonomy_terms_from_different_levels_programmatically.md
Last active June 25, 2024 12:30
Drupal 8 || 9 - Getting Taxonomy Terms from different levels programmatically

Introduction

In this snippet I've gathered some examples and cases about how to get taxonomy terms programmatically in Drupal, using always the same method and the same mechanics: get terms and then processing it in order to get only the required under certain criteria.

Author

@davidjguru
davidjguru / Blocks.md
Created November 12, 2020 17:47 — forked from bdlangton/Blocks.md
Drupal 8 programmatic solutions

Render custom blocks

$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);

Render plugin blocks

$block_manager = \Drupal::service('plugin.manager.block');
@lisawolderiksen
lisawolderiksen / git-commit-template.md
Last active June 28, 2024 17:15
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@Villanuevand
Villanuevand / README-español.md
Last active July 2, 2024 22:33
Una plantilla para hacer un buen README.md. Inspirado en el gist de @PurpleBooth => https://gist.github.com/PurpleBooth/109311bb0361f32d87a2

Título del Proyecto

Acá va un párrafo que describa lo que es el proyecto

Comenzando 🚀

Estas instrucciones te permitirán obtener una copia del proyecto en funcionamiento en tu máquina local para propósitos de desarrollo y pruebas.

Mira Deployment para conocer como desplegar el proyecto.

@cesarmiquel
cesarmiquel / drupal-8-cheatsheet.md
Last active May 24, 2024 06:01
Drupal 8/9/10 Cheatsheet

Drupal 8 Cheatsheet

[Update 2024] - This gist is almost useless compared to Drupal at your fingertips. Will create pull requests to update that if something is not already there.

Files, Images and Media

// Load file object
$file = File::load($fid);
@ingeit
ingeit / models.ex
Last active July 4, 2023 20:02
backup mysql automatico con schedule completo nodejs
var mysqlDump = require('mysqldump');
//npm install node-schedule --save
var schedule = require('node-schedule');
var j = schedule.scheduleJob(' 12 * * * * * ', function(){
// * * * * * *
// ┬ ┬ ┬ ┬ ┬ ┬
// │ │ │ │ │ |
// │ │ │ │ │ └ day of week (0 - 7) (0 or 7 is Sun)
// │ │ │ │ └───── month (1 - 12)
@lightonphiri
lightonphiri / bash-install_google_fonts_on_ubuntu.md
Last active May 27, 2024 17:53
Install Google Fonts on Ubuntu

Install Google Fonts

Download desired fonts

https://fonts.google.com/?selection.family=Open+Sans

Install Google Fonts on Ubuntu

cd /usr/share/fonts
sudo mkdir googlefonts
cd googlefonts
sudo unzip -d . ~/Downloads/Open_Sans.zip

@AdrianSchneider
AdrianSchneider / Spaceless.php
Created September 28, 2011 16:55
Removes whitespace between HTML tags in PHP
$response = trim(preg_replace('/>\s+</', '><', $response));