Skip to content

Instantly share code, notes, and snippets.

View JPustkuchen's full-sized avatar

Julian Pustkuchen JPustkuchen

View GitHub Profile
@jerbob92
jerbob92 / MyModuleMenuLink.php
Created October 27, 2015 13:31
Drupal 8 Derative Advanced Menu Link Example
@juampynr
juampynr / mymodule.md
Last active July 16, 2022 23:41
Drupal 7 Database Updates tricks

This document contains a common database updates in Drupal 7 projects.

Change a field type from textarea to textfield (wipe out its data)

Let's suppose we want to change field_article_summary from text to textarea, but we do not care about loosing its current data.

Start by removing the field through the Admin Interface in your local environment. Then, add the field with the new configuration and recreate the feature where it was exported. Finally, add the following database update:

@chales
chales / cache-warmer-3.sh
Last active January 19, 2022 14:01
A couple of simple options to parse sitemap.xml to warm the cache or for other actions such as generating memory_profiler checks.
# This can be added to your cron job to run right after Drupal's cron or combine them into a single command so
# that it automatically executes when the cron run completes.
wget -q http://www.example.com/sitemap.xml -O - | egrep -o "http://www\.example\.com[^<]+" | wget -q -i - -O /dev/null --wait 1
@jehoshua02
jehoshua02 / .bash_alias_composer
Created October 4, 2012 05:32
Bash aliases for Composer
alias composer='php composer.phar'
alias composerinit='curl -s http://getcomposer.org/installer | php; composer init; echo composer.phar >> .gitignore'
alias composerdump='composer dumpautoload --optimize'