Skip to content

Instantly share code, notes, and snippets.

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

Theodoros Ploumis theodorosploumis

🏠
Working from home
View GitHub Profile
@theodorosploumis
theodorosploumis / upgrade_html5_text_format.php
Last active February 10, 2024 21:58
Drupal 10.x - Update text_format of all the wysiwyg fields in bulk (drush script)
<?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";
@theodorosploumis
theodorosploumis / install_patch.sh
Created May 15, 2023 18:39
Install specific patch version on server
#!/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
@theodorosploumis
theodorosploumis / drupal-version.rb
Last active May 4, 2023 07:13
Get the latest stable and supported Drupal versions on the cli
#! /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'))
@theodorosploumis
theodorosploumis / ai_ideas.md
Last active April 1, 2023 19:14
AI ideas for Developers
  • 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
@theodorosploumis
theodorosploumis / git_ui.md
Created February 18, 2023 14:10
Needs for an online git UI (GitHub etc)

Git online GUI

  • Online access
  • User roles and permissions
  • Code display and formatter
  • Link to code/line of.
  • Pull Requests
  • Collaboration on code and issues
  • CI/CD automation
  • Git tags and versions
@theodorosploumis
theodorosploumis / composer_patches_lenient.md
Last active March 3, 2023 14:21
List of Drupal lenient 10.x patches for common used modules.
@theodorosploumis
theodorosploumis / drupal7_rich_fields_report.sh
Last active February 28, 2023 11:36
Find Drupal 7.x rich texts (HTML) tags and shortcodes.
#!/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.
@theodorosploumis
theodorosploumis / HTMLToReact.tsx
Created May 12, 2022 21:26 — forked from natterstefan/HTMLToReact.tsx
html-react-parser | TypeScript solution
/**
* Works in Next.js 10.x
*/
import React from 'react'
import parse, {
domToReact,
attributesToProps,
Element,
HTMLReactParserOptions,
} from 'html-react-parser'

Next.js

Next.js Trend

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.

Why use a framework?

@theodorosploumis
theodorosploumis / requirements_matrix.md
Last active February 14, 2024 14:34
System requirements matrix support
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