Here's some Linux (particularly Ubuntu) Command Line Interface (CLI) basics
# Command for listing files
ls
# Shows all files and in a nicer layout with the options l and a
ls -la
/** queryCSSByPropertyName | |
* queries the CSSOM looking for CSS rulesets containing a particular CSS property. | |
* @param {string} queryPropName CSS property name | |
* @param {string} queryPropValue value of CSS property | |
* @returns Map with key as CSS selector, value as CSS properties. | |
*/ | |
function queryCSSByProperty(queryPropName, queryPropValue) { | |
const styleSheets= document.styleSheets; // get all the stylesheets | |
const properties = new Map(); // set up the variable that'll store our result | |
<?php | |
// Machine name for our custom node | |
define('NODE_NAME', 'the_node_machine_name'); | |
// Machine name for our custom taxonomy | |
define('TAXONOMY_NAME', 'the_taxonomy_machine_name'); | |
function module_install() { | |
_create_taxonomy(); | |
_create_content_type(); | |
} |
{ | |
"env": { | |
"browser": true | |
}, | |
"globals": { | |
"Drupal": true, | |
"jQuery": true, | |
"tinyMCE": true | |
}, | |
"rules": { |
<?php | |
// the current environment | |
$env = $_ENV['ENVTYPE'] ? $_ENV['ENVTYPE'] : ''; | |
// paths to search for drupal sites | |
$paths = array( | |
'/var/www/multisites/', | |
'/var/www/schoolyard/', | |
); |
#!/usr/bin/php | |
<?php | |
/** | |
* @file | |
* This is a Git pre-commit hook that informs you when you are | |
* about to commit whitespace or a debug function. | |
*/ | |
$red = "\033[1;31m"; | |
$red_end = "\033[0m"; |
<?php | |
$args = drush_get_arguments(); | |
if ( ! isset($args[2]) ) { | |
drush_set_error('Usage: drush @<alias> scr generate-strongarm.php <module_name> <base_path>'); | |
exit(); | |
} | |
$module_name = $args[2]; | |
if ( ! isset($args[3]) ) { |