Skip to content

Instantly share code, notes, and snippets.

View davidjguru's full-sized avatar
🍅
Working within a pomodoro cycle

David Rodriguez davidjguru

🍅
Working within a pomodoro cycle
View GitHub Profile
@PSF1
PSF1 / gist:f82d31920fa1032e12dce1513948cc89
Created February 19, 2024 10:37
Steps to add a new action operation to Entity
Steps to add a new operation to Entity:
- In the entity class:
-- Add definition in handlers/form
-- Override handlers/route_provider with a new route generator.
-- Add route template in links
- Create a new form to manage the operation.
- Generate a new route in the route generator class.
- Add operation in the entity's ListBuilder.
@MatthieuScarset
MatthieuScarset / MyCustomForm.php
Last active November 11, 2023 20:24
Drupal - Autosubmit exposed form in JS
<?php
namespace Drupal\mymodule\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Provides a custom form.
*/
@junaidpv
junaidpv / UpdateCommands.php
Created December 28, 2021 13:27
Drush command to fix "non-existent config entity name returned by FieldStorageConfigInterface::getBundles()" errors reported at https://www.drupal.org/project/drupal/issues/2916266
<?php
namespace Drupal\my_module\Commands;
use Drush\Commands\DrushCommands;
use Drupal\Core\KeyValueStore\KeyValueFactoryInterface;
/**
* A Drush commandfile.
*
@Seldaek
Seldaek / ext-requires.txt
Last active February 15, 2020 18:52
PHP Extension Requirements on Packagist.org
Taken from packagist.org
Packages with a master branch update since June 1st 2018: 98977
Of those, package having requires on PHP extensions: 11676 (11.79%)
As only ~12% of packages declare their extension requirements,
and even then it might not be a complete list, take all this with
a big grain of salt, it is informative but definitely not a
complete picture of the most used extensions.
@markf3lton
markf3lton / blt-hands-on-tutorial.md
Last active February 1, 2023 18:24
BLT Hands On Tutorial
@tatianamac
tatianamac / tatiana-mac-speaker-rider.md
Last active March 24, 2024 12:22
Tatiana Mac's Speaker Rider

Speaker Rider

by Tatiana Mac

Last updated 14 April 2021

What is a speaker rider?

As speaking comes with immense privilege, I have crafted a speaker rider to set expectations and boundaries around my engagement. I am grateful to all the conference organisers who have brilliantly hosted me. I would love to continue to exercise this privilege to speak at conferences, and use this privilege to make the landscape more accessible and beneficial to tech's most historically excluded and marginalised communities.

Considerations

😫 I provide a lot of explanations for those of you who never had to consider these things. Most thoughtful conferences I've attended check most of these boxes intrinsically, particularly when conference runners are experienced speakers. They get it.

@Erikdekamps
Erikdekamps / module.install
Last active May 27, 2021 12:56
Drupal 8 - Load taxonomy terms sorted by weight
/**
* Get taxonomy terms sorted by weight.
*
* @param int $vid
* The vocabulary id.
*
* @return array
* Returns an array of term id | name.
*
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
@Tamal
Tamal / git-ssh-error-fix.sh
Last active April 16, 2024 13:32
Solution for 'ssh: connect to host github.com port 22: Connection timed out' error
$ git clone git@github.com:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
$ # This should also timeout
$ ssh -T git@github.com
ssh: connect to host github.com port 22: Connection timed out
$ # but this might work
@chx
chx / Table.php
Created December 6, 2018 21:02
Plain table migration source plugin
<?php
namespace Drupal\sd8_migration\Plugin\migrate\source;
use Drupal\migrate\Plugin\migrate\source\SqlBase;
/**
* Table source from database.
*
@signalpoint
signalpoint / example.php
Last active July 16, 2022 23:41
Drupal 8 Set Message Example
<?php
// The drupal_set_message() function is being deprecated!
// @see https://api.drupal.org/api/drupal/core%21includes%21bootstrap.inc/function/drupal_set_message/8.5.x
// > Deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
// > Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
// In some custom code.
\Drupal::messenger()->addMessage('Say something else');