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 | |
/** @var \Drupal\node\Entity\Node[] $landing_pages */ | |
$landing_pages = \Drupal::entityTypeManager() | |
->getStorage('node') | |
->loadByProperties([ | |
'type' => 'landing_page' | |
]); | |
$old_paragraph_fields = [ | |
'field_tile_section', |
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
<VirtualHost *:80> | |
ServerName reveal.dev | |
ServerAlias *.reveal.dev | |
VirtualDocumentRoot /Users/les.peabody/presentations/%1 | |
<Directory /Users/les.peabody/presentations/*> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Order allow,deny | |
Allow from all |
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
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "Usage: sphp [phpversion]" | |
exit 1 | |
fi | |
currentversion=`php -r "echo str_replace('.', '', substr(phpversion(), 0, 3));"` | |
newversion="$1" |
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
#!/bin/bash | |
# Help menu | |
print_help() { | |
cat <<-HELP | |
This script is used to fix permissions of a Drupal installation | |
you need to provide the following arguments: | |
1) Path to your Drupal installation. | |
2) Username of the user that you want to give files/directories ownership. | |
3) HTTPD group name (defaults to www-data for Apache). | |
Usage: (sudo) bash ${0##*/} --drupal_path=PATH --drupal_user=USER --httpd_group=GROUP |
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
# Write a program that outputs all possibilities to put + or - or nothing | |
# between the numbers 1, 2, ..., 9 (in this order) such that the result is | |
# always 100. For example: 1 + 2 + 34 – 5 + 67 – 8 + 9 = 100. | |
# 1 + [2..9] | |
# 1 - [2..9] | |
# 12 + [3..9] | |
# 12 - [3..9] | |
# 123 + [4..9] | |
# 123 - [4..9] |
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
def get_operands(comma_indexes) | |
base = (1..9).to_a | |
last_index = 0 | |
operands = [] | |
comma_indexes.each do |comma_index| | |
operands.push(base[last_index..(comma_index-1)].join) | |
last_index = comma_index | |
end | |
operands.push(base[last_index..8].join) | |
get_plus_minus_combinations_100(operands) |
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 | |
/** | |
* Get a revision id list for a particular entity. | |
*/ | |
function _get_entity_revision_list($type, $entity) { | |
$info = entity_get_info($type); | |
if (!isset($info['revision table'])) { | |
// If this entity does not track revisions then return FALSE. | |
return FALSE; | |
} |