Skip to content

Instantly share code, notes, and snippets.

Cyle Carlson jacerider

View GitHub Profile
@jacerider
jacerider / 01-README.md
Created May 2, 2018 — forked from petemcw/01-README.md
Mac OS X LEMP Configuration
View 01-README.md

Mac OS X LEMP Configuration

This Gist is a collection of configuration files that can be used to easily setup a Homebrew-based LEMP stack on Mac OS X.

Files in this repository are numbered and named for ordering purposes only. At the top of each file is a section of metadata that denote what component the file belongs to and the default name & location of the file. Feel free to implement it however you want.

Note: some configuration files have hard-coded paths to my user directory -- fix it for your setup

Setup

@jacerider
jacerider / wildcard
Last active Feb 7, 2018
Wildcard SSL generator for local dev
View wildcard
#!/bin/bash
set -e
#Set fonts for Help.
NORM=`tput sgr0`
BOLD=`tput bold`
REV=`tput smso`
SSL_PATH="${HOME}/Sites/ssl"
@jacerider
jacerider / jQuery | Plugin Boilerplate.js
Last active Mar 1, 2017
A jQuery Plugin Boilerplate
View jQuery | Plugin Boilerplate.js
(function ($, Drupal, window, document) {
'use strict';
var pluginName = 'uxFormInput';
function Plugin(element, options) {
this.element = element;
this._name = pluginName;
@jacerider
jacerider / D8 | Programmatically Remove Field.md
Last active Dec 12, 2018
Programmatically remove a field in Drupal 8.
View D8 | Programmatically Remove Field.md
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\field\Entity\FieldConfig;

$bundles = ['user'];

$fields['user_picture'] = [
  'entity_type' => 'user',
];
@jacerider
jacerider / D8 | Programmatically Create Field.md
Last active Jan 18, 2020
Programmatically create a field in Drupal 8.
View D8 | Programmatically Create Field.md
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\field\Entity\FieldConfig;

$bundles = ['user'];

$fields['user_picture'] = [
  'type' => 'image',
  'entity_type' => 'user',
  'bundle' => 'user',
@jacerider
jacerider / D8 | BlockPluginInstance.md
Created Jan 12, 2017
Create a block plugin instance directly and pass it the configuration
View D8 | BlockPluginInstance.md
$configuration = [];
$variables['block_output'] = \Drupal::service('plugin.manager.block')
  ->createInstance($plugin_id, $configuration)
  ->build();
@jacerider
jacerider / D8 | BlockExisting.md
Last active Jan 12, 2017
D8 | Reuse an existing block
View D8 | BlockExisting.md
$block = \Drupal\block\Entity\Block::load('your_block_id');
$variables['block_output'] = \Drupal::entityTypeManager()
  ->getViewBuilder('block')
  ->view($block);
You can’t perform that action at this time.