- Code reviews (eg on Pull Requests)
- Testing (eg Cypress, Behat, PHPUnit)
- Code debugging
- Explain code
- Create code documentation
- Find code docs
- Learn something new
- Get code examples
- Extend code (eg a class)
- Validate code according to standards
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// phpcs:ignoreFile | |
// Update text_format of all the wysiwyg fields. | |
// Exec with drush: "drush scr upgrade_html5_text_format.php" | |
// Change values according to your needs. | |
$old_format = "html"; | |
$new_format = "html5"; | |
$field_type = "text_long"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
wget https://ftp.gnu.org/gnu/patch/patch-2.7.6.tar.gz | |
tar xf patch-2.7.6.tar.gz | |
rm patch-2.7.6.tar.gz | |
cd patch-2.7.6 | |
./configure | |
make | |
mkdir ~/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
# Get the latets stable and supported Drupal versions on the cli | |
require 'nokogiri' | |
require 'open-uri' | |
require 'colorize' | |
# Fetch and parse HTML document | |
doc = Nokogiri::HTML(URI.open('https://www.drupal.org/project/drupal')) |
Based on the plugin at https://github.com/mglaman/composer-drupal-lenient. See also https://www.drupal.org/docs/develop/using-composer/using-drupals-lenient-composer-endpoint.
composer require mglaman/composer-drupal-lenient
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# Prevent errors in a pipeline from being masked | |
set -o pipefail | |
set -e | |
# A script that generates a simple txt report for all the rich texts (that allow HTML value) on a Drupal 7.x project. | |
# The report is searching inside each field for special HTML tags or shortcodes. | |
# The script is useful for Migration processes as also as for a general overview of the HTML tags found inside fields. | |
# Requires drush 8.x, php. Can also work with ddev. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Works in Next.js 10.x | |
*/ | |
import React from 'react' | |
import parse, { | |
domToReact, | |
attributesToProps, | |
Element, | |
HTMLReactParserOptions, | |
} from 'html-react-parser' |
You've heard great things about this new web framework called Next.js, but you're still not sure why people are using it.
One way to understand why you should learn Next.js is to understand what problems it solves. This directly translates to why it's become so popular.
Software | PHP | Composer | Drush | Symfony | Twig | Node.js | Drupal |
---|---|---|---|---|---|---|---|
Drupal 7.x | 5.4+ | 1.x | 6+ | 2.8 - 3.x | 1+ | 4+ | |
Drupal 8.x | 7.0+ | 1.x | 8+ | 3.4 - 4.x | 1+ | 4+ | |
Drupal 9.x | 7.3+ | 2.x | 10+ | 4.4 - 5.x | 2+ | 8+ | |
Drupal 10.x | 8.0+ | 2.x | 10+ | 5.x | 2+ | 12+ | |
Open Social 10.x | 7.0+ | 8.8 - 9.1 | |||||
Open Social 11.x | 7.4 - 8.x | 9.x | |||||
Open Social 12.x | 8.1+ | 10.2.x | |||||
NextJS 12.x |
NewerOlder