Skip to content

Instantly share code, notes, and snippets.

View abelperezlindo's full-sized avatar
🧉
*Ruidito de mate*

abelpzl abelperezlindo

🧉
*Ruidito de mate*
  • Argentina
View GitHub Profile
@davidjguru
davidjguru / intro_drupal_8_9_getting_taxonomy_terms_from_different_levels_programmatically.md
Last active December 10, 2024 14:15
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 April 24, 2025 02:56
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

@mariovalney
mariovalney / pre-commit
Last active January 31, 2025 19:28
Pre-commit hook to check code with PHPCS, fix with PHPCBF and check mess with PHPMD
#!/bin/sh
#########################
# #
# Initializing #
# #
#########################
##
# You should add all tools as composer dependencies or change this path
@Villanuevand
Villanuevand / README-español.md
Last active April 25, 2025 00:25
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 April 8, 2025 21:15
Drupal 8/9/10 Cheatsheet

Drupal 8/9/10 Cheatsheet

[Update 2024] - Take a look at Drupal at your fingertips. Lot's of great stuff 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 April 26, 2025 06:21
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));