This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Override or insert variables into the HTML head. | |
* | |
* @param $head_elements | |
* An array of variables to pass to the HTML head. | |
*/ | |
function MYTHEME_html_head_alter(&$head_elements) { | |
// remove unneeded metatags | |
$remove = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: drupal_dev | |
vars: | |
document_root: d7 | |
admin_user: root | |
admin_pass: root | |
db_name: d7 | |
db_user: root | |
db_pass: root | |
disable_modules: overlay toolbar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: [hostgroup] | |
# hostgroup name to aplly playbook from ~/.ansible/hosts | |
vars: | |
project_name: [project_name] | |
# project name for backup files | |
document_root_location: [document_root_location] | |
# document root location path without trailing slash | |
# Example: /home/dtest01 | |
document_root_folder: [document_root_folder] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# PHP CodeSniffer pre-commit hook for git | |
# We should place it to server scripts directory to subfolder drupal-git-hooks and add hook symlink from | |
# repository .git directory to path/to/drupal-git-hooks | |
# ln -s -f /path/to/drupal-git-hooks .git/hooks | |
PHPCS_BIN=/usr/bin/phpcs | |
PHPCS_CODING_STANDARD=Drupal | |
PHPCS_IGNORE= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drop schema public cascade; | |
create schema public; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo docker run -p 8000:80 -p 2200:22 -v $(pwd):/var/www/html:rw dockie/drupal-site-install | |
sudo docker ps | |
sudo docker exec -it [containerhash] bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin resize-sprite($map, $sprite, $percent) { | |
$spritePath: 'generated/' + sprite-path($map); | |
$spriteWidth: image-width($spritePath); | |
$spriteHeight: image-height($spritePath); | |
$width: image-width(sprite-file($map, $sprite)); | |
$height: image-height(sprite-file($map, $sprite)); | |
@include background-size(ceil($spriteWidth * ($percent/100)) ceil($spriteHeight * ($percent/100))); | |
background-image: image_url($spritePath); | |
width: ceil($width*($percent/100)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
current_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/*\(.*\)/\1/' | |
} | |
mrgto(){ | |
branch="$(current_git_branch)" | |
git checkout $1 | |
git fetch origin $1 | |
git merge origin/$1 | |
git merge $branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MemCache | |
$conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc'; | |
$conf['cache_default_class'] = 'MemCacheDrupal'; | |
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache'; | |
$conf['page_cache_invoke_hooks'] = FALSE; | |
$conf['memcache_servers'] = array( | |
'127.0.0.1:11228' => 'default', | |
'127.0.0.1:11229' => 'cluster1', | |
'127.0.0.1:11230' => 'cluster2', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Callback function for delete all nodes. | |
* | |
* @param array $types_of_content | |
* Array of machine node type names to delete. | |
* | |
* @param array $except_uids | |
* Array with uids of ingnore users who created nodes. | |
*/ | |
function _delete_all_nodes($types_of_content, $except_uids = array()) { |
OlderNewer