Skip to content

Instantly share code, notes, and snippets.

View chelsiejohnston's full-sized avatar

Chelsie Johnston chelsiejohnston

View GitHub Profile
@chelsiejohnston
chelsiejohnston / .bashrc
Last active February 27, 2016 00:08
"fracc" — A useful alias for" drush fra -y" (revert all features) and "drush cc all" (clear caches) — D7
# If you find yourself constantly reverting features and clearing caches, for example as part of QA work, then you may find this little alias useful.
#
# Bonus: you now get to use "fracc" as a verb (or an adjective) when talking with your peers.
alias fracc="drush fra -y && drush cc all"
RewriteEngine On # Turn on the rewriting engine
RewriteCond %{HTTP_HOST} ^(www\.)?example\.org$ [NC]
RewriteRule ^(.*)$ http://example.org/docroot/$1
RewriteRule ^(.*)$ docroot/$1 [L]
@chelsiejohnston
chelsiejohnston / LocalAwareRedirectResponseTrait.php
Created March 20, 2016 17:20
core/lib/Drupal/Core/Routing/LocalAwareRedirectResponseTrait.php
/**
* {@inheritdoc}
*/
protected function isLocal($url) {
print $url;
var_dump(UrlHelper::externalIsLocal($url, $this->getRequestContext()->getCompleteBaseUrl()));
var_dump($this->getRequestContext()->getCompleteBaseUrl());
return !UrlHelper::isExternal($url) || UrlHelper::externalIsLocal($url, $this->getRequestContext()->getCompleteBaseUrl());
}