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
| "use strict"; | |
| // Load plugins | |
| const autoprefixer = require("autoprefixer"); | |
| const browsersync = require("browser-sync").create(); | |
| const cp = require("child_process"); | |
| const cssnano = require("cssnano"); | |
| const del = require("del"); | |
| const eslint = require("gulp-eslint"); | |
| const gulp = require("gulp"); |
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 | |
| // Example usage: $build = blocks_get_blocks_by_region('sidebar_first'); | |
| function blocks_get_blocks_by_region($region_name) { | |
| $build = []; | |
| $blocks = entity_load_multiple_by_properties('block', ['theme' => $GLOBALS['theme'], 'region' => $region_name]); | |
| uasort($blocks, 'Drupal\block\Entity\Block::sort'); | |
| foreach ($blocks as $key => $block) { |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft,elem.offsetTop,elem.offsetWidth,elem.offsetHeight,elem.offsetParent
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
| npm uninstall -g gulp | |
| npm install -g gulp | |
| npm uninstall --save-dev gulp | |
| npm install --save-dev gulp |
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
| @mixin quantity-query($selector, $type, $amount, $max: null) { | |
| @if $type == at-least { | |
| #{$selector}:nth-last-child(n+#{$amount}), | |
| #{$selector}:nth-last-child(n+#{$amount}) ~ #{$selector} { @content; } | |
| } @else if $type == at-most { | |
| #{$selector}:nth-last-child(-n+#{$amount}):first-child, | |
| #{$selector}:nth-last-child(-n+#{$amount}):first-child ~ #{$selector} { @content; } | |
| } @else if $type == between { | |
| @if type-of($max) != "number" { | |
| @error "Max value must be a number for quantity-query."; |
###Installing Apache 2.4 + PHP 5.6 + MySQL + SSL on Mac OS X Yosemite This is a TL;DR version of an upcoming blog entry for those who can read bash commands and scripts.
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 | |
| /** | |
| * Change a field from textfield to textarea | |
| * Unlike other guides online, this one actually corrects the blob values | |
| * Run this using drush: `drush scr <filepath>` | |
| */ | |
| $field_name = "field_test_text_field_2"; |
NewerOlder