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
| Array.from(document.querySelectorAll('section a span')).filter(function(el){return el.textContent.indexOf("@") > -1}).reduce(function(ac,cv){return ac + cv.textContent + ", "}); |
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 Drupal\node\Entity\Node; | |
| $entity = Node::load(1183); | |
| $fields = array_keys($entity->getFieldDefinitions()); | |
| dpm($fields); | |
| foreach($fields as $field_name) { | |
| dpm("Field Name"); | |
| dpm($field_name); | |
| dpm("--------------"); | |
| dpm("Field Value"); | |
| dpm($entity->get($field_name)->value); |
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
| $roles = \Drupal::entityTypeManager()->getStorage('user_role')->loadMultiple(); | |
| //dpm($roles); | |
| foreach($roles as $role){ | |
| if($role->hasPermission('use sourcex transition keep_in_pending_publishing')){ | |
| dpm($role->label()); | |
| } | |
| } |
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
| var options = { | |
| root: document.querySelector('null'), | |
| rootMargin: '0% 0% 75% 0%', | |
| threshold: 1.0 | |
| } |
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
| chrome.extension.sendMessage({}, function (response) { | |
| var readyStateCheckInterval = setInterval(function () { | |
| if (document.readyState === "complete") { | |
| clearInterval(readyStateCheckInterval); | |
| var options = { | |
| root: document.querySelector('null'), | |
| rootMargin: '0% 0% 75% 0%', | |
| threshold: 1.0 | |
| } |
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
| alias cd...="cd ../.." | |
| alias cd....="cd ../../.." | |
| alias cd.....="cd ../../../.." | |
| alias chrome="open -a 'Google Chrome'" | |
| alias emacs="emacs -nw" |
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
| Create a new Drupal 9 project on existing DO node with all things installed. | |
| composer create-project drupal-composer/drupal-project:8.x-dev content --stability dev --no-interaction | |
| If you want to set up everything on a new DO server follow the below gist. | |
| // For set up check | |
| https://gist.github.com/nkgokul/fe117844d122033e8eb125bd7d1550c6 |
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
| server { | |
| root /usr/share/zabbix; | |
| server_name my-monitoring.example.com; | |
| location / { | |
| index index.html index.htm index.php; | |
| } | |
| error_page 500 502 503 504 /50x.html; | |
| location = /50x.html { | |
| root /usr/share/nginx/html; | |
| } |
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
| grep -v '^#' zabbix_server.conf | grep -v '^$' |
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
| getTOCHtml(); | |
| function getTOCHtml() { | |
| let TOCHtml = "" | |
| $$("h2,h3,h4,h5").forEach(function(ele){ | |
| TOCHtml += `<a href='#${ele.id}'>${ele.innerText}</a><br/>` ; | |
| //console.log(ele.innerText); | |
| }) | |
| //console.log(TOCHtml); | |
| var parentElement = $('.postArticle-content'); |