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
@juampynr
juampynr / RoboFile.php
Last active October 9, 2021 10:07
Drupal 8 common migration tasks
<?php
/**
* Command line tasks.
*
* @codingStandardsIgnoreStart
* @codeCoverageIgnore
* @SuppressWarnings(PHPMD)
*/
class RoboFile extends \Robo\Tasks {
@ahmadhasankhan
ahmadhasankhan / ImageMagick-6.7.7-10.md
Last active December 4, 2022 18:57
Install ImageMagick 6.7.7-10 on Unix using binary

Remove imagemagick

sudo apt-get --purge remove imagemagick
sudo apt autoremove

Install Required package:

sudo apt-get install build-essential 
sudo apt-get install checkinstall
@tkrotoff
tkrotoff / FrontendFrameworksPopularity.md
Last active March 13, 2025 08:13
Front-end frameworks popularity (React, Vue, Angular and Svelte)
@dustinleblanc
dustinleblanc / .lando.yml
Created August 6, 2018 23:29
Magic Robofile for Acquia sites
name: client
recipe: drupal7
config:
webroot: docroot
xdebug: true
php: '7.1'
via: nginx
services:
appserver:
composer:
@HoldOffHunger
HoldOffHunger / bradvin.social.share.urls.txt
Last active March 7, 2025 19:26
Social Share URL's (Summary)
https://www.facebook.com/sharer.php?u={url}
https://www.facebook.com/dialog/share?app_id={app_id}&display={page_type}&href={url}&redirect_uri={redirect_url}
https://reddit.com/submit?url={url}&title={title}
https://twitter.com/intent/tweet?url={url}&text={title}&via={user_id}&hashtags={hash_tags}
https://www.linkedin.com/sharing/share-offsite/?url={url}
https://api.whatsapp.com/send?phone={phone_number}&text={title}%20{url}
https://www.tumblr.com/widgets/share/tool?canonicalUrl={url}&title={title}&caption={text}&tags={hash_tags}
http://pinterest.com/pin/create/button/?url={url}
https://www.blogger.com/blog-this.g?u={url}&n={title}&t={text}
https://www.evernote.com/clip.action?url={url}&title={title}
@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');
@cesarmiquel
cesarmiquel / drupal-8-cheatsheet.md
Last active March 6, 2025 19:17
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);
@drugan
drugan / Drupal 8: alter field widget form element
Created August 31, 2017 16:20
The filed widget defines how a field or collections of fields are displayed on the form. As an example is taken ProductVariationAttributesWidget of the Commerce 2.x module.
<?php
/**
* Implements hook_field_widget_WIDGET_TYPE_form_alter().
*
* Place this code into YOUR_MODULE.module file replacing YOUR_MODULE placeholder
* with your modules' name.
*/
function YOUR_MODULE_field_widget_commerce_product_variation_attributes_form_alter(&$element, FormStateInterface $form_state, $context) {
// Make ajax responsive changes on attribute fields' properties.
@crittermike
crittermike / import.php
Last active August 28, 2024 06:43
Importing Drupal 8 config programmatically
<?php
// Import arbitrary config from a variable.
// Assumes $data has the data you want to import for this config.
$config = \Drupal::service('config.factory')->getEditable('filter.format.basic_html');
$config->setData($data)->save();
// Or, re-import the default config for a module or profile, etc.
\Drupal::service('config.installer')->installDefaultConfig('module', 'my_custom_module');
@paceaux
paceaux / tinyRules.css.md
Last active May 19, 2024 11:15
Tiny rules for how to name things in CSS and JS

Tiny rules for how to name stuff

CSS

How to name CSS classes

Stateful Class names

Is it a state that is only one of two conditions? (i.e. a boolean)