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 hook_form_BASE_FORM_ID_alter()(array &$form, FormStateInterface $form_state){ | |
$form['#validate'][] = 'module_remove_decimal_errors'; | |
} | |
function module_remove_decimal_errors(array &$form, FormStateInterface $form_state) { | |
$errorsToRemove = array('field_your_field][0][value','field_your_other_field][0][value'); | |
$errorsToKeep = array(); | |
$currentErrors = $form_state->getErrors(); |
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
// update password | |
drush user-password username --password=password | |
// generate a hash to manually add to database | |
php core/scripts/password-hash.sh password | |
// url to reset | |
/user/password | |
// drush change password |
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
(powershell) | |
terminus site:create "--org"'"orgName"' "newSiteMachineName" "newSiteHumanName" "upstreamHash" | |
(windows cmd) | |
terminus site:create --org "orgName" "newSiteMachineName" "newSiteHumanName" "upstreamHash" |
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
<div | |
class="featured-media featured-media--full-height featured-media--align-center clearfix background-image-swap" | |
style="background-image:url('/sites/default/files/styles/600x400/public/2017-10/maxresdefault.jpg?itok=E5qxr2Dx');" | |
data-src-set=" | |
/sites/default/files/styles/2400x1600/public/2017-10/maxresdefault.jpg?itok=F7dLgnBM|all and (min-width: 1800px)| | |
/sites/default/files/styles/1800x1200/public/2017-10/maxresdefault.jpg?itok=iiH_TyjT|all and (min-width: 1201px) and (max-width: 1799px)| | |
/sites/default/files/styles/1200x800/public/2017-10/maxresdefault.jpg?itok=a5RsL9YX|all and (min-width: 961px) and (max-width: 1200px)| | |
/sites/default/files/styles/900x600/public/2017-10/maxresdefault.jpg?itok=tlhEVdgF|all and (min-width: 601px) and (max-width: 960px)| | |
/sites/default/files/styles/600x400/public/2017-10/maxresdefault.jpg?itok=E5qxr2Dx|| | |
" |
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
rsync -razv -e 'ssh -p 2222' --ignore-existing files live.*site_id*@appserver.live.*site_id*.drush.in:files/ |
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 adw_calendar_query_views_events_list_alter(Drupal\Core\Database\Query\AlterableInterface $query){ | |
if( | |
$query->getMetaData('view')->getDisplay()->display['id'] == 'page_1' | |
|| $query->getMetaData('view')->getDisplay()->display['id'] == 'page_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
<?php | |
function module_query_views_events_alter(Drupal\Core\Database\Query\AlterableInterface $query){ | |
// If this the right query | |
if( | |
$query->getMetaData('view') != '' | |
&& $query->getMetaData('view')->getDisplay()->display['id'] == 'block_3' | |
){ |
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 composer memory limit: | |
export COMPOSER_MEMORY_LIMIT=-1 | |
If php memory limit: | |
php -d memory_limit=-1 $(which composer) {{ command goes here }} |
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
nvm install | |
nvm use | |
npm install | |
npm run dev {url} (optional watches changes) | |
npm run build (full build pre-commit) |
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
query { | |
nodeQuery( | |
filter: { | |
conditions: [ | |
{ | |
operator: EQUAL, | |
field: "type", | |
value: ["page"] | |
}, | |
{ |
OlderNewer