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
# Automatically format/wrap text | |
:set tw=79 | |
:set formatoptions+=t | |
# ...select text... | |
gq |
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
# This assumes you already have installed vim, and syntastic (and of course php). | |
# Download the Drupal coder module. You could do this via other methods but git is nice. | |
# You can place this wherever, but take note of where you placed it. Something like | |
# /usr/local/src might be good. | |
git clone --branch 8.x-2.x http://git.drupal.org/project/coder.git | |
# Install php code sniffer (phpcs). Using pear. | |
pear install PHP_CodeSniffer |
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 | |
// See http://www.php.net/manual/en/class.domelement.php#101243 | |
function get_inner_html( $node ) { | |
$innerHTML= ''; | |
$children = $node->childNodes; | |
foreach ($children as $child) { | |
$innerHTML .= $child->ownerDocument->saveXML( $child ); | |
} | |
return $innerHTML; |