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
#!/usr/bin/php | |
<?php | |
/** | |
* @file | |
* A Git pre-commit hook script to check files for PHP syntax errors and Drupal | |
* coding standards violations. Requires phpcs and Coder Sniffer: | |
* | |
* @see https://drupal.org/node/1419988 | |
* |
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 | |
namespace Drupal\test_module\Plugin\Block; | |
use Drupal\Core\Block\BlockBase; | |
/** | |
* Provides a 'Test block' Block. | |
* | |
* @Block( |
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 | |
// array_map with $key => $value | |
return array_map(function($key, $value) { | |
return [$key => $value]; | |
}, array_keys($my_array), $my_array); |
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 | |
/** | |
* Reset fields from dev. | |
* | |
* @param $sandbox | |
*/ | |
function loom_solr_multisite_update_8010(&$sandbox) { | |
/** @var MultisiteSearchService $multisite */ | |
$multisite = Drupal::service('loom.solr_multisite.utility'); |
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
/** | |
* Implements hook_update_N(). | |
* | |
* Remove nodes for faster testing. | |
*/ | |
function hook_update_8001(&$sandbox) { | |
$etm = \Drupal::entityTypeManager(); | |
$types = $etm->getStorage('node_type')->loadMultiple(); | |
$nodeStorage = $etm->getStorage('node'); | |
foreach ($types as $label => $type) { |
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
<div id="page" class="stockists"> | |
<br> | |
<h3 style="padding-left: 30px; text-align: center;">Goldie's Natural Beauty is proudly stocked and carefully curated at our favorite retailers!</h3> | |
<div class="row" style="display: flex; flex-wrap: wrap;"> | |
<div class="span3 adaptive-grid"> | |
<h3>Fort Pilates</h3> | |
<p>672 Fulton Street</p> | |
<p>Brooklyn, NY 11217</p> | |
<p><span>(917) 522-2777</span></p> | |
<p><span>www.fortpilates.com/</span></p> |
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
parameters: | |
http.response.debug_cacheability_headers: true | |
twig.config: | |
debug: true | |
auto_reload: true | |
cache: false | |
services: | |
cache.backend.null: | |
class: Drupal\Core\Cache\NullBackendFactory |
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
drush sql-dump > ${PWD##*/}-$(date +%Y-%m-%d\-%H-%M).sql | |
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
var jq = document.createElement('script'); | |
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
// ... give time for script to load, then type (or see below for non wait option) | |
jQuery.noConflict(); |
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 | |
$url = array ( | |
'http://youtu.be/dQw4w9WgXcA', | |
'http://www.youtube.com/embed/dQw4w9WgXcB', | |
'http://www.youtube.com/watch?v=dQw4w9WgXcC', | |
'http://www.youtube.com/?v=dQw4w9WgXcD', | |
'http://www.youtube.com/v/dQw4w9WgXcE', | |
'http://www.youtube.com/e/dQw4w9WgXcF', | |
'http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcG', |
NewerOlder