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
#!/bin/bash | |
while read LINE; do | |
# cURL the url and write to file. | |
curl -o /dev/null --silent --progress-bar --head --write-out '%{http_code} | %{url_effective}\n' "$LINE" >> result.txt | |
# Echo the line in terminal. | |
echo "$LINE" | |
# The file name below. | |
done < urls.txt |
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
From: https://www.a2hosting.com/kb/developer-corner/mysql/determining-the-size-of-mysql-databases-and-tables | |
To determine the sizes of all of the tables in a specific database, at the | |
mysql> prompt, type the following command. Replace database_name with the | |
name of the database that you want to check: | |
SELECT table_name AS "Table", | |
ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" | |
FROM information_schema.TABLES | |
WHERE table_schema = "DATABASE_NAME" |
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
Get: https://github.com/bramus/mixed-content-scan | |
Fix: ~/.composer/vendor/bin directory in your PATH | |
Run: ~/.composer/vendor/bin/mixed-content-scan http://example.com --output=/Users/username/Desktop/results.txt |
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
// The languages array. | |
$languages = [ | |
'dutch' => [ | |
'label' => 'Dutch', | |
'translations' => [ | |
'nl' => 'Nederlands', | |
'de' => 'Niederländisch', | |
], | |
], | |
'english' => [ |
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
/** | |
* Get taxonomy terms sorted by weight. | |
* | |
* @param int $vid | |
* The vocabulary id. | |
* | |
* @return array | |
* Returns an array of term id | name. | |
* | |
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException |
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
/** | |
* Helper function for adding translations. | |
* | |
* @param array $strings | |
* The array with strings and their translations. | |
*/ | |
function _my_module_add_translations(array $strings) { | |
// Get locale storage service. | |
$storage = \Drupal::service('locale.storage'); |
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
<h1>Testing display of HTML elements</h1> | |
<p>This is the document <code>header</code></p> | |
<h1>This is 1st level heading</h1> | |
<p>This is a test paragraph.</p> | |
<h2>This is 2nd level heading</h2> | |
<p>This is a test paragraph.</p> | |
<h3>This is 3rd level heading</h3> | |
<p>This is a test paragraph.</p> | |
<h4>This is 4th level heading</h4> | |
<p>This is a test paragraph.</p> |
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
{ | |
"data": { | |
"content": [ | |
{ | |
"unique_id": 1, | |
"name": "Pagina 1", | |
"photo_file": "P01", | |
"paragraph_text": "PA01" | |
}, | |
{ |
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
{ | |
"data": { | |
"content": [ | |
{ | |
"photo_id": "P01", | |
"photo_url": "https://dummyimage.com/300.png", | |
"photo_dimensions": [240, 351] | |
}, | |
{ | |
"photo_id": "P02", |
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
{ | |
"data": { | |
"content": [ | |
{ | |
"paragraph_id": "PA01", | |
"paragraph_text": "1 - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi risus odio, condimentum non bibendum sit amet, rhoncus eu magna. Nunc scelerisque efficitur turpis pellentesque hendrerit." | |
}, | |
{ | |
"paragraph_id": "PA02", | |
"paragraph_text": "2 - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi risus odio, condimentum non bibendum sit amet, rhoncus eu magna. Nunc scelerisque efficitur turpis pellentesque hendrerit." |