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
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@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
@facelordgists
facelordgists / delete-git-recursively.sh
Created May 13, 2015 05:28
Recursively remove .git folders
( find . -type d -name ".git" && find . -name ".gitignore" && find . -name ".gitmodules" ) | xargs rm -rf
@keopx
keopx / settings.local.php
Last active March 25, 2024 12:22
Drupal 8 Redis settings.local.php
<?php
/**
* Set redis configuration.
*/
/** @see: https://docs.platform.sh/frameworks/drupal8/redis.html */
if (extension_loaded('redis')) {
// Set Redis as the default backend for any cache bin not otherwise specified.
// $settings['cache']['default'] = 'cache.backend.redis';
@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.

@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.
@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.
*
@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.
*/
@jez500
jez500 / d8-views-exp-form-alter.php
Last active October 12, 2023 12:20
Drupal 8 - Hook form alter views exposed form
<?php
/**
* Implements hook_form_alter().
*/
function MYMODULE_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
$view_names = array('my_view_name');
$view = $form_state->getStorage('view');
if ($form_id == 'views_exposed_form' && in_array($view['view']->id(), $view_names)) {
// Do some shilzzle.
@bdlangton
bdlangton / Blocks.md
Last active October 12, 2023 08:40
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');