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
| // Dowload form_mode_manager from git and using composer. | |
| "repositories": [ | |
| { | |
| "type": "composer", | |
| "url": "https://packages.drupal.org/8", | |
| "exclude": [ | |
| "drupal/form_mode_manager" | |
| ] | |
| }, | |
| { |
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 declare(strict_types = 1); | |
| namespace Drupal\custom_search\EventSubscriber; | |
| use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
| use Symfony\Component\HttpKernel\Event\RequestEvent; | |
| use Symfony\Component\HttpKernel\Event\ResponseEvent; | |
| use Symfony\Component\HttpKernel\KernelEvents; | |
| use Drupal\search_api_solr\Event\PreQueryEvent; | |
| use Drupal\search_api_solr\Event\SearchApiSolrEvents; |
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 | |
| // This file will reside in modules/custom/YOURMODULE/src/Config | |
| namespace Drupal\custom_event\Config; | |
| use Drupal\Core\Cache\CacheableMetadata; | |
| use Drupal\Core\Config\ConfigFactoryOverrideInterface; | |
| use Drupal\Core\Config\StorageInterface; | |
| /** | |
| * Example configuration override. |
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
| # To see the 10 biggest files, run this from the root directory: | |
| $ git verify-pack -v .git/objects/pack/pack-7b03cc896f31b2441f3a791ef760bd28495697e6.idx \ | |
| | sort -k 3 -n \ | |
| | tail -10 | |
| # To see what each file is, run this: | |
| $ git rev-list --objects --all | grep [first few chars of the sha1 from previous output] | |
| # Rewrite all the commits: | |
| $ git filter-branch --index-filter 'git rm --cached --ignore-unmatch "Folder Name/*"' -- --all |
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
| # use sudo apt-get update command to download package information from all configured sources. | |
| # The sources often defined in the /etc/apt/sources. | |
| sudo apt update | |
| # upgrade google chrome to latest stable version | |
| sudo apt --only-upgrade install google-chrome-stable | |
| # check the google chrome version | |
| google-chrome --version |
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
| // Git global setup | |
| git config --global user.name "your git username" | |
| git config --global user.email "your git email address" | |
| // Create a new repository | |
| git clone <.git url> | |
| cd project_folder | |
| touch README.md | |
| git add README.md | |
| git commit -m "add README" |
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
| $.ajax({ | |
| url: '/myurl/ajax', | |
| type: 'POST', | |
| data : { | |
| title: title, | |
| type : type, | |
| target: target, | |
| view : view, | |
| display:display | |
| }, |
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\Renderer; | |
| use Drupal\Core\Ajax\AjaxResponse; | |
| use Drupal\Core\Form\FormBuilder; | |
| /** | |
| * Drupal\Core\Block\BlockManager definition. | |
| * | |
| * @var \Drupal\Core\Block\BlockManager | |
| */ |
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\Ajax\AjaxResponse; | |
| use Drupal\views\Views; | |
| use Drupal\Core\Render\Renderer | |
| /** | |
| * Drupal\Core\Render\Renderer definition. | |
| * | |
| * @var \Drupal\Core\Render\Renderer |
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 | |
| function __callURLinBackground($url) { | |
| exec("wget -bqc ".$url." -P /var/www/html/", $output, $result_code); | |
| echo $output; | |
| echo $result_code; | |
| echo '<pre>';print_r($output); | |
| echo '<pre>';print_r($result_code); | |
| echo 'Running in background'; | |
| } | |
| // call a URL in background |