This file contains 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
global-css: | |
version: 2 | |
css: | |
theme: | |
dist/main.css: {} | |
global-js: | |
js: | |
dist/main.js: {} | |
dependencies: |
This file contains 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
# Add to .gitignore. | |
.lando.yml | |
.ddev | |
.vscode | |
# Drush aliases can be used by anyone, but you might not want to add to repo. | |
# drush/sites/self.sites.yml |
This file contains 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
/** | |
* Wipe a sheet's data completely and replace it with new data. | |
* | |
* The method used will conserve the sheet itself along with | |
* properties of that sheet. Properties could include frozen rows | |
* and some named ranges. | |
* | |
* @param sheetName | |
* Name of the sheet (currently must exist). | |
* @param arrayOfArrays |
This file contains 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 you want to find node pages with a string on them. Replace FINDME | |
# This is pretty intensive it will load and render all nodes in your site. | |
drush ev '$st = \Drupal::entityTypeManager()->getStorage("node"); $b= \Drupal::entityTypeManager()->getViewBuilder("node"); $ns = $st->loadMultiple(); foreach ($ns as $node) { print "FINDME " . $node->id() . "\n"; $built = $b->view($node, "default"); $o = \Drupal::service("renderer")->renderRoot($built); var_dump($o); }' | grep FINDME |
This file contains 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 | |
// src/Access/FooAccess.php | |
namespace Drupal\foo\Access; | |
use Drupal\Core\Access\AccessResult; | |
use Drupal\Core\Entity\EntityInterface; | |
use Drupal\webform\Access\WebformEntityAccess; | |
use Drupal\webform\WebformInterface; |
This file contains 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
/** | |
* Implements hook_field_widget_form_alter(). | |
*/ | |
function mytheme_field_widget_form_alter(&$element, $form_state, $context) { | |
$plugin_id = $context['widget']->getPluginId(); | |
$paragraph_type = isset($element['#paragraph_type']) ? $element['#paragraph_type'] : FALSE; | |
$parent_bundle = isset($element['#bundle']) ? $element['#bundle'] : FALSE; | |
$hidden_fields = []; | |
$group_links = FALSE; |
This file contains 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] | |
co = checkout | |
br = branch | |
ci = commit | |
cp = cherry-pick | |
st = status | |
cor = !sh -c 'git fetch $1 $2 && git checkout $2' - | |
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit | |
pushset = push --set-upstream origin | |
[core] |
This file contains 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/bash | |
DOMAIN=${1:-"missing"} | |
if [[ ${DOMAIN} = "missing" ]] ; then | |
echo "Pass a Drupal site please, like https://example.com" | |
exit 1 | |
fi | |
echo "What is your user name for ${DOMAIN}:" | |
read USER |
This file contains 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
These are not prod safe settings. Performance is not suitable for | |
general use. | |
Security or heavy performance things are commented out. You may want to | |
enable them manually. | |
To use, place these files in your sites/default/settings.php | |
should include the local.settings.php (if it exists). Then exclude | |
local.settings.* files in your .gitignore. |
This file contains 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
# Reges for finding drupal entities. | |
/<drupal-entity.*?data-entity-uuid="(.{36})">\s*?<\/drupal-entity>/ | |
# raw data for command linking UUID with file | |
ahoy drush sqlq "SELECT m.mid as mid, m.uuid as uuid, mfd.status, f.fid as fid, f.filemime, f.filesize, f.filename, f.uri, mfd.name FROM media m INNER JOIN media_field_data mfd ON m.mid = mfd.mid INNER JOIN media__field_media_file mff ON m.mid = mff.entity_id INNER JOIN file_managed f ON mff.field_media_file_target_id = f.fid;" | |
# rough command | |
gsed -i -e s/PLACEHOLDER_12312312-1231-1231-1231-123123123123_PLACEHOLDER/"[<a href=\\\\\"\/sites\/default\/files\/SOMEFILE.pdf\\\\\">PDF: 8818 KB<\/a>]"/g ~/Backups/iwork.sql && echo "12312312-1231-1231-1231-123123123123" |
NewerOlder