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
If it's distribution, let the documentation exists and point your vhost entry to demo folder. | |
make a .gitignore file from example.gitignore file | |
check if settings file, files folder and other unnecesary files like *~ are excluded. | |
do got init to initiliaze a git repo | |
do git status to see list of files. | |
add git config username and email | |
add git remote origin points to push your repo | |
do commit and push it. | |
Hola! and you are done. |
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 apt-get install libgnome-keyring-dev | |
cd /usr/share/doc/git/contrib/credential/gnome-keyring | |
sudo make | |
git config --global credential.helper /usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring | |
to store in cache: | |
#18000 = 5 hrs | |
git config --global credential.helper "cache --timeout=18000" |
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 | |
use Drupal\Core\Render\BubbleableMetadata; | |
/** | |
* @implements hook_token_info(). | |
*/ | |
function my_module_token_info() { | |
$type = [ | |
'name' => t('Custom tokens'), |
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
$('document').ready(function () { | |
// Below code takes care of adding All checkbox to options. | |
var i = 0; | |
$(".form-checkboxes").each(function () { | |
i++; | |
// Add events.all checkbox only if there are more than 2 options. | |
if ($(this).children().length > 2) { |
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
Temporarily use the drush, drupal console and composer. | |
Drupal Console: | |
// download the drupal console php archive file | |
curl https://drupalconsole.com/installer -LO drupal.phar | |
// set executable on your phar file | |
chmod +x drupal.phar | |
// Set alias to use | |
alias dc="/path/to/file/drupal.phar" | |
// check if its working |
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
settings = { | |
scheme: 'http', | |
port: 8080, | |
host: 'localhost', | |
resource: '/socket.io', | |
serviceKey: 'any-id-same-as-in-drupal-config', | |
backend: { | |
port: 80, | |
host: 'site-host-name', | |
scheme: 'http', |
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 apt-get install openjdk-8-jdk | |
cd /opt | |
sudo wget http://www.us.apache.org/dist/lucene/solr/6.3.0/solr-6.3.0.tgz | |
sudo tar xzf solr-6.3.0.tgz solr-6.3.0/bin/install_solr_service.sh --strip-components=2 | |
sudo ./install_solr_service.sh solr-6.3.0.tgz |
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
/** | |
* Adds a given user as member with given role to given group. | |
* @param GroupInterface $group | |
* Group Entity | |
* @param UserInterface $user | |
* An user account entity of type User Interface , not of Account Interface. | |
* @param array $role | |
* A group role in format : [GROUPTYPE]-[role] Ex: group-teacher | |
*/ | |
function add_member_to_group(GroupInterface $group, UserInterface $user, $role) { |
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 | |
use Drupal\Core\Url; | |
$entities = [node_object]; | |
$scheme = 'public'; | |
$filename = 'something.pdf'; | |
$export_type = 'pdf'; | |
/* @var \Drupal\entity_print\PrintBuilder $print_builder */ |