Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
rm -rf output_dev/
sculpin generate --server --watch
{
"default_line_ending": "unix",
"ensure_newline_at_eof_on_save": true,
"fallback_encoding": "UTF-8",
"file_exclude_patterns":
[
"*.pyc",
"*.pyo",
"*.exe",
"*.dll",
<?php
$users = [
[ 'uid' => 21 ],
[ 'uid' => 22 ],
[ 'uid' => 23 ],
[ 'uid' => 24 ],
[ 'uid' => 25 ],
[ 'uid' => 26 ],
];
<?php
use Symfony\Component\Finder\Finder;
/**
* Implements hook_views_default_views().
*/
function MYMODULE_views_default_views() {
// Find all .view.inc files in a the views/ directory, and include them.
$finder = new Finder();
<?xml version="1.0" encoding="UTF-8" ?>
<node_export created="Tue, 01 Dec 2015 20:11:46 +0000">
<node>
<vid>1</vid>
<uid>1</uid>
<title>Comis Duis Jumentum Nostrud Vereor</title>
<log></log>
<status>1</status>
<comment>2</comment>
<promote>1</promote>
@opdavies
opdavies / st2-d7-project.json
Last active December 16, 2015 08:39
A default Drupal 7 project file for Sublime Text 2
{
"folders":
[
{
"path": "/",
"file_exclude_patterns":
[
"drupal/.gitignore",
"drupal/.htaccess",
"drupal/authorize.php",
@opdavies
opdavies / hook-form-alter-add-action-classes.php
Last active December 29, 2015 15:19
Add classes to form actions in Drupal 7
<?php
/**
* Implements hook_form_alter().
*/
function MYTHEME_form_alter(&$form) {
// Add additional classes to each form action.
if (isset($form['actions'])) {
$actions = element_children($form['actions']);
foreach ($actions as $action) {
@opdavies
opdavies / _classes.scss
Last active December 29, 2015 15:59
A library of custom classes to include within a SCSS project.
// Include this within your main "_init.scss" file using
// @import "classes";
// The opposite of Drupal's .js-hide class which hides an element when
// JavaScript is enabled (this hides an element when JavaScript is disabled).
// Add this to an element using the @extend directive. For example:
//
// .tabs {
// @extend %no-js-hide.
// }
@opdavies
opdavies / settings.php
Last active January 16, 2016 18:09
Drupal 8 settings.
<?php
$settings['hash_salt'] = '';
$settings['update_free_access'] = FALSE;
$settings['container_yamls'][] = __DIR__ . '/services.yml';
if (file_exists(__DIR__ . '/settings.local.php')) {
include __DIR__ . '/settings.local.php';
@opdavies
opdavies / download-the-phar.sh
Last active March 21, 2016 06:55
Install the Drupal VM Generator.
curl -s https://www.drupalvmgenerator.com/download -L -o drupalvm-generate.phar