Skip to content

Instantly share code, notes, and snippets.

@kane-thornwyrd
Last active December 20, 2015 05:19
Show Gist options
  • Save kane-thornwyrd/6077052 to your computer and use it in GitHub Desktop.
Save kane-thornwyrd/6077052 to your computer and use it in GitHub Desktop.
Some modules worth throwing as a starter kit.

Just a set of tools for Drupal Dev

alias dr='drush -v'
alias drupal_watchdog='dr ws --tail'
alias drupal_codesniffer='$BASH_SCRIPTS_PATH/drupal_code_sniffer'
alias mysql_backup='$BASH_SCRIPTS_PATH/mysql_db_save'
#!/bin/bash
for arg in $*
do if [ -d $arg ]
then
echo "Scanning $arg …"
phpcs --standard=DrupalCodingStandard --extensions=php,module,inc,install,test,profile,theme $arg
else
phpcs --standard=DrupalCodingStandard $arg
fi
done
; created by: Jean-cédric Thérond
; licence: GNU GPL 3+
core = 7.x
projects[] = drupal
api = 2
projects[cck][subdir] = "contrib"
projects[token][subdir] = "contrib"
projects[admin_menu][subdir] = "contrib"
projects[module_filter][subdir] = "contrib"
projects[iframe_filter][subdir] = "contrib"
projects[elf][subdir] = "contrib"
projects[geo_filter][subdir] = "contrib"
projects[video_filter_field][subdir] = "contrib"
projects[entity][subdir] = "contrib"
projects[ctools][subdir] = "contrib"
projects[features][subdir] = "contrib"
projects[strongarm][subdir] = "contrib"
projects[taxonomy_manager][subdir] = "contrib"
projects[search404][subdir] = "contrib"
projects[wysiwyg][subdir] = "contrib"
projects[imce][subdir] = "contrib"
projects[transliteration][subdir] = "contrib"
projects[linkit][subdir] = "contrib"
projects[search_api][subdir] = "contrib"
projects[elysia_cron][subdir] = "contrib"
projects[pathauto][subdir] = "contrib"
projects[redirect][subdir] = "contrib"
projects[globalredirect][subdir] = "contrib"
projects[views][subdir] = "contrib"
projects[views_bulk_operations][subdir] = "contrib"
projects[htmlmail][subdir] = "contrib"
projects[echo][subdir] = "contrib"
projects[emogrifier][subdir] = "contrib"
projects[pathologic][subdir] = "contrib"
; Wysiwygs
; CKEditor 3.6.3
libraries[ckeditor][download][type] = get
; TODO: Update with the latest version URL
libraries[ckeditor][download][url] = http://download.cksource.com/CKEditor/CKEditor/CKEditor%203.6.3/ckeditor_3.6.3.tar.gz
; TinyMCE 3.5.4.1
libraries[tinymce][download][type] = git
libraries[tinymce][download][url] = git://github.com/tinymce/tinymce.git
libraries[tinymce][download][branch] = master
#!/bin/bash
NOM_BASE=$1
UTILISATEUR_MYSQL=$2
MOTDEPASSE_MYSQL=$3
FILENAME=$(date +%F-%T)_$NOM_BASE.sql.backup.bz2
mysqldump --user=$UTILISATEUR_MYSQL --password=$MOTDEPASSE_MYSQL $NOM_BASE -q --single-transaction -R -t --disable-keys --complet$
echo "\"$FILENAME\" DONE !"
#!/bin/sh
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
git config --global merge.tool meld
git config --global alias.last = "!f() { git cat-file commit HEAD $@ | git name-rev --stdin ; } ; f"
@kane-thornwyrd
Copy link
Author

For Windows users TL;DR :

Type that in your cmd:

git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"

You'll get a cool alias git lg that show you a prettier log of previous commits with a tree.

Keep this command somewhere, it's an incredible fast way to back up a MySQL Database:

mysqldump --user=[USER] --password=[PASSWORD] [DATABASE] -q --single-transaction -R -t --disable-keys  --complete-insert | zip > mydbsave.sql.zip

Two more usefull commands for Drush this time:

drush -v [your normal drush command]
drush ws --tail
  • -v then your usual drush command, like dl views, will force drush to be in verbose mode, showing you more of his working process.
  • ws --tail will display the last few watchdog entries, dynamically refreshed, mean you don't need to get access to your watchdog page and refresh it anymore !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment