Skip to content

Instantly share code, notes, and snippets.

Dorian Damon ummdorian

Block or report user

Report or block ummdorian

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:bc0259df3e52548f9a23b28b3dab368b
If composer memory limit:
export COMPOSER_MEMORY_LIMIT=-1
If php memory limit:
php -d memory_limit=-1 $(which composer) {{ command goes here }}
@ummdorian
ummdorian / index.php
Created Mar 28, 2018
Drupal 8 Query Alter Group By (views)
View index.php
<?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'
){
@ummdorian
ummdorian / module_name.php
Created Feb 27, 2018
Views Nested Condition Group
View module_name.php
<?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'
){
@ummdorian
ummdorian / pantheon rsync files
Last active Feb 13, 2018
send files to pantheon via rsync
View pantheon rsync files
rsync -razv -e 'ssh -p 2222' --ignore-existing files live.*site_id*@appserver.live.*site_id*.drush.in:files/
@ummdorian
ummdorian / gist:9e0b978efbf9191d43b4a01e2b5f7abd
Last active Oct 19, 2017
Responsive Background Image Swapping
View gist:9e0b978efbf9191d43b4a01e2b5f7abd
<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||
"
@ummdorian
ummdorian / Terminus site create commands for windows
Created Sep 20, 2017
Terminus site create commands for windows
View Terminus site create commands for windows
(powershell)
terminus site:create "--org"'"orgName"' "newSiteMachineName" "newSiteHumanName" "upstreamHash"
(windows cmd)
terminus site:create --org "orgName" "newSiteMachineName" "newSiteHumanName" "upstreamHash"
@ummdorian
ummdorian / Lemme log in tho
Last active Jul 5, 2018
Windows powershell change drupal 8 user password
View Lemme log in tho
// 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
@ummdorian
ummdorian / Fix for Drupal 8 decimal field validation.php
Last active Mar 7, 2017
Fix for Drupal 8 decimal field validation fix re: "invalid number error" addressed here: https://www.drupal.org/node/2230909
View Fix for Drupal 8 decimal field validation.php
<?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();
You can’t perform that action at this time.