Skip to content

Instantly share code, notes, and snippets.


Ruben Egiguren keopx

View GitHub Profile
juampynr /
Last active January 31, 2023 18:54
Drupal 7 Views 3 custom field handler
dependencies[] = ctools
; Views Handlers
files[] = views/
juampynr /
Last active December 30, 2015 05:48
Drupal 7's upgrade path
// NOTE This has been moved to
* @file
* Runs a set of steps to upgrade a database to be in line with code.
* Implements hook_drush_command().
View gist:9229562
function drupal-install() {
sudo rm -rf sites/default;
sudo git checkout -- sites/default;
sudo chmod -R 777 sites/default;
sudo chown -R `whoami` sites/default;
sudo git checkout -- sites/default;
sudo chown -R `whoami` sites/default;
killua99 /
Created May 7, 2014 21:14
bash script to generate changelog focused for Drupal modules
# Author: Luigi Guevara <@killua99>
# Use
# For a Simple Tag changelog
# ./changelog > CHANGELOG.txt
# For a current dev branch with the old tag log
# ./changelog 7.x-2.x > CHANGELOG.txt
sqndr / example.jquery.js
Created July 16, 2014 10:45
jQuery plugin example (js)
View example.jquery.js
example: function(options) {
var defaults = {
color: '#000000',
# Check arguments and requirements.
if [ ${#@} -lt 1 ]; then
echo "This script expects one argument (site machine name)."
exit 1
if [ -x ${HOME}/.my.cnf ]; then
echo "This script requires ${HOME}/.my.cnf."
keopx /
Last active April 25, 2017 17:18
Drupal 8 reinstall site script
cd drupal
sudo rm -fr vendor
composer install
sudo chmod 777 sites/default
cd sites/default
rm -fr settings.php services.yml
# for developers only (sets up some dev mode settings, do this before install!)
cp ../example.settings.local.php ./settings.local.php
# for everyone
facine / __INDEX.txt
Last active April 6, 2023 09:21
Drupal 8 - Examples
View __INDEX.txt
# Taxonomy terms:
# Menu links:
# File items:
# Nodes:
mortendk /
Last active April 29, 2016 09:32
Drupal8 concept for selecting templates form the ui

template chooser

Drupal8 is pretty awesome, but its a problem that you cant choose fromt the ui which template to use. Sure you can overwrite whats there (node--article.html.twig) but that dont give the end user a chance to later change in the site & can end up in even more templates & clutter.

template suggestions

Make it easy to provide a template suggestion for entities, blocks, pages, nodes, fields, menues, username, everything that have a template you should be able to give a suggestion.

class selector

A prepopulated list of classes that can be selected for a template.

The modules userbase is sitebuilders & themes that wants to provide variations for a site, developers dont have to provide templates after a site is build, and can rely on the theme to provide all the variations.


Download DrupalConsole

curl -L -o drupal.phar

Make DrupalConsole globaly accesible

$ mv console.phar /usr/local/bin/drupal