Skip to content

Instantly share code, notes, and snippets.

View jacine's full-sized avatar
😁

Jacine Luisi jacine

😁
View GitHub Profile
parameters:
session.storage.options:
# Default ini options for sessions.
#
# Some distributions of Linux (most notably Debian) ship their PHP
# installations with garbage collection (gc) disabled. Since Drupal depends
# on PHP's garbage collection for clearing sessions, ensure that garbage
# collection occurs by using the most common settings.
# @default 1
gc_probability: 1
@jacine
jacine / setup.md
Last active September 24, 2016 15:14
Drupal 8 setup

Drupal 8 Setup

  1. Copy sites/default/default.settings.php, renaming to sites/default/settings.local.php.
  2. Copy sites/default/development.services.yml, renaming to sites/default/services.yml.

Changes in settings.local.php:

@todo Write out details. https://gist.github.com/jacine/4520c74beb5b77ef5af8

@jacine
jacine / theming-hell.php
Last active July 6, 2016 21:50
Give me my HTML in my Drupal 8 menu links!
<?php
/**
* Implements hook_preprocess_menu().
*/
function THEME_preprocess_menu(&$vars, $hook) {
if ($hook == 'menu__account') {
$items = $vars['items'];
foreach ($items as $key => $item) {
if ($key == 'user.page') {
@jacine
jacine / .theme.php
Last active July 6, 2016 18:46
HTML in menu items D8
<?php
/**
* Implements hook_preprocess_menu().
*/
function THEME_preprocess_menu(&$vars, $hook) {
if ($hook == 'menu__main') {
$items = $vars['items'];
foreach ($items as $key => $item) {
$original_title = $vars['items'][$key]['title'];
libraries-override:
contextual/drupal.contextual-links:
css:
component:
/core/modules/contextual/css/contextual.module.css: false
theme:
/core/modules/contextual/css/contextual.theme.css: css/overrides/contextual.theme.css
/core/modules/contextual/css/contextual.icons.theme.css: false
options:
formatter: stylish
files:
include: '**/*.s+(a|c)ss'
# ignore:
rules:
# Extends
extends-before-mixins: 1
extends-before-declarations: 1
placeholder-in-extend: 1
{
"rules": {
// http://stylelint.io/user-guide/rules/
// http://stylelint.io/user-guide/example-config/
"at-rule-empty-line-before": "never",
"at-rule-name-case": "lower",
"at-rule-name-space-after": "always-single-line",
"at-rule-no-vendor-prefix": true,
"at-rule-semicolon-newline-after": "always",
"block-closing-brace-newline-after": "always-multi-line",
@jacine
jacine / mytheme.theme.php
Last active August 8, 2016 13:20
Container Context!
<?php
use Drupal\Core\Render\Element;
/**
* Implements hook_theme_suggestions_HOOK_alter().
*/
function THEME_theme_suggestions_container_alter(array &$suggestions, array $variables) {
if (!empty($variables['element'])) {
$element = $variables['element'];
@jacine
jacine / composer.md
Last active August 31, 2016 19:13
Composer

Composer Workflow

Composer is a package manager similar to NPM for JavaScript, but for dealing with PHP packages. We use it to manage Drupal core, contributed modules (and other 3rd party libraries needed) and patches. The following section is a quick reference for common tasks. Ensure you have installed/updated Composer before proceeding.

*Note about Git: While this will be obvious to most, it bears mentioning that after you're finished installing, updating or patching with Composer, you'll need to add the changes/additions to version control.

Contributed Modules

Note: When a specific version isn't specified, composer prefers stable over RC over beta over alpha over DEV releases.