Skip to content

Instantly share code, notes, and snippets.

View cmcintosh's full-sized avatar
💭
Looking For Projects

Chris McIntosh cmcintosh

💭
Looking For Projects
View GitHub Profile
@cmcintosh
cmcintosh / starbase.deltaui
Created September 5, 2021 10:59 — forked from johnpenny/starbase.deltaui
starbase.deltaui
PROJECT: DELTA UI
BY: Oo
COMPANY: io
V: 1.1
LIC: FREE if you leave in the credit
$: Any IN-GAME donations are welcome
---------------------------------------------------------------------------
#### HOW TO INSTALL
@cmcintosh
cmcintosh / composer.json
Created January 19, 2021 12:50 — forked from mpociot/composer.json
Simple ReactPHP chat server - connect to it: nc laracon.beyondco.de 8000
{
"require": {
"react/event-loop": "^1.1",
"react/stream": "^1.1",
"react/promise": "^2.8",
"react/socket": "^1.6",
"react/http": "^1.2",
"nubs/random-name-generator": "^2.2"
}
}
@cmcintosh
cmcintosh / D8 | Programmatically Create Field.md
Created October 20, 2020 20:56 — forked from jacerider/D8 | Programmatically Create Field.md
Programmatically create a field in Drupal 8.
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\field\Entity\FieldConfig;

$bundles = ['user'];

$fields['user_picture'] = [
  'type' => 'image',
  'entity_type' => 'user',
  'bundle' => 'user',
@cmcintosh
cmcintosh / import.php
Created August 6, 2020 13:20 — forked from crittermike/import.php
Importing Drupal 8 config programmatically
<?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');

Create a good backup

Put the site in version control

Create a Github copy of the code if it doesn't already exist. Start your first commit with everything exactly the way it is before you start. If the project already has git, do perserve the git history.

Backup the files and database

Name and Date the backup. Do this before you change anything. Just in case.

@cmcintosh
cmcintosh / pre-commit
Last active August 29, 2015 14:07 — forked from jpoesen/pre-commit
#!/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
* Hat tip: dcq.module (DrupalCodeQuality)