Picture a wealthy English household in the early 1900s. Think of a computer—the hardware—as a big house, the family’s residence. The house consists of plumbing and lighting, bricks and mortar, windows and doors—all manner of physical things and processes.
Next, imagine computer software as the people in the house. The household staff, living downstairs, provide a whole range of services at once. The butler stands by the door, the driver washes the car, the housekeeper presses the linen, the cook provides meals and bakes cakes, the gardener rakes the leaves from the lawn. And this activity, which seemingly happens of its own accord, is coordinated by the head of the household staff. Such is the life of the downstairs dwellers, who in a certain sense exist in the background.
Then consider the people upstairs. They are the whole reason for the toil of the people downstairs. The husband desires a driver not simply for peace of mind but because he wishes to travel. The wife employs a cook, so her family
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
sudo iptables -A INPUT -s [IPADDRESSHERE] -j DROP |
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
// Note that this is strange and horrible, but it works. | |
jQuery('.slick-slider-2').on('init', function(event, slick) { | |
jQuery(this).find('.slick-dots li:eq(0)').addClass('asg-slick-active'); | |
jQuery(this).find('.slick-dots li:eq(1)').addClass('asg-slick-active-next'); | |
jQuery(this).find('.slick-dots li:first-child').before('<li class="asg-slick-active-prev"></li>'); | |
jQuery(this).find('.slick-dots li:last-child').after('<li></li>'); | |
}); | |
jQuery(".slick-slider-2").slick({ |
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
# Open the actual running container | |
docker exec -it PROJECTNAME_local_www sh | |
# Run the command in a throwaway container | |
docker-compose -f build.yml run --rm cli |
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 | |
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml'; | |
$settings['cache']['bins']['render'] = 'cache.backend.null'; | |
$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null'; |
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 | |
// Import arbitrary config from a variable. | |
// Assumes $data has the data you want to import for this config. | |
$config = \Drupal::service('config.factory')->getEditable('filter.format.basic_html'); | |
$config->setData($data)->save(); | |
// Or, re-import the default config for a module or profile, etc. | |
\Drupal::service('config.installer')->installDefaultConfig('module', 'my_custom_module'); |
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
version: '3.1' | |
services: | |
www: | |
container_name: gravtest_www | |
image: outrigger/apache-php:php71 | |
network_mode: "bridge" | |
environment: | |
DOCROOT: /var/www | |
volumes: |
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
volumes: | |
# Just specify a path and let the Engine create a volume | |
- /var/lib/mysql | |
# Specify an absolute path mapping | |
- /opt/data:/var/lib/mysql | |
# Path on the host, relative to the Compose file | |
- ./cache:/tmp/cache |
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 | |
// Grab an instance of the "Block Reaction" plugin. | |
$context_reaction = context_get_plugin('reaction', 'block'); | |
// Run the block_list() function to find the blocks being rendered | |
// into the region you specify. | |
$context_blocks = $context_reaction->block_list('REGIONNAME'); | |
// Now make sure that we reset the static cache for the block list in case |
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
<div id="widget-container"></div> | |
<script type="text/javascript"> | |
// First grab the `view` param from the query string, if it exists | |
var reg = new RegExp( '[?&]' + 'view' + '=([^&#]*)', 'i' ); | |
var paramSearch = reg.exec(window.location.search); | |
var param = paramSearch ? paramSearch[1] : ''; | |
// Then build the JS file | |
var js = document.createElement("script"); |