Skip to content

Instantly share code, notes, and snippets.

View Deele's full-sized avatar

Nils Deele

View GitHub Profile
@Deele
Deele / backup_drupal_project.sh
Last active August 21, 2019 13:31
Create backup archive of Drupal project files
View backup_drupal_project.sh
#!/bin/bash
#
# Settings
#
DIRECTORY="drupal-project"
#
# Begin
@Deele
Deele / mail_tester.php
Last active November 4, 2019 15:34
Mail sending tester via Sfiftmailer (originally made for use with `drupal/swiftmailer` and `drupal/smtp` composer packages installed)
View mail_tester.php
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$autoloadPath = 'autoload.php';
if (!file_exists($autoloadPath)) {
$autoloadPath = '../' . $autoloadPath;
if (!file_exists($autoloadPath)) {
$autoloadPath = '../' . $autoloadPath;
}
@Deele
Deele / README.md
Last active July 13, 2021 18:56 — forked from TylerFisher/README.md
Google Spreadsheets script to generate transliterated slugs from a range of cells
View README.md

This script for Google Spreadsheets allows you to generate slugs for your data such as might be used for creating unique urls.

Use it like this!

# A B C
1 a b slug
2 foo baz bing =slugify(A2:B4)
3 bar BAZ
4 FOO baz-bing
@Deele
Deele / ContentEntityMigrationTool.php
Created March 14, 2019 09:58
Drupal 8 Content Entity Migration Tool
View ContentEntityMigrationTool.php
<?php
/**
* @property integer $total Total entities in set
* @property array $unchanged entities that were left unchanged
* @property array $succeeded entities that was successfully migrated
* @property array $failed entities that failed to migrate
* @property bool $success if all the entities were successfully migrated
*/
class ContentEntityMigrationResult extends stdClass
@Deele
Deele / updateSettings.js
Last active June 6, 2018 02:06
Deep extend of JSON-type settings (JS objects) with options (JS objects)
View updateSettings.js
/**
* @param {object} settings
* @param {object} options
* @returns {object}
*/
function updateSettings(settings, options) {
var updatedSettings = {};
if (typeof settings !== 'undefined') {
Object.assign(updatedSettings, settings);
}
@Deele
Deele / duplicateIdsMonitoring.js
Last active September 4, 2017 14:26
Monitors document body for duplicate IDs and warns in console when that happens (potential for chrome extension)
View duplicateIdsMonitoring.js
(function (window) {
// Based on https://stackoverflow.com/a/14570614/588973
window.observeDOM = (function () {
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver,
eventListenerSupported = window.addEventListener;
return function (obj, callback) {
if (MutationObserver) {
// define a new observer
@Deele
Deele / TinyMce.php
Last active July 28, 2017 09:46
Implemented an option to call widget initialization on demand (for PJAX, AJAX or other purposes).
View TinyMce.php
<?php
/**
* @copyright Copyright (c) 2013-2017 2amigOS! Consulting Group LLC
* @link http://2amigos.us
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
*/
namespace dosamigos\tinymce;
use yii\helpers\Html;
use yii\helpers\Json;
@Deele
Deele / backend__config__main.php
Last active July 29, 2021 19:28
Yii2 (advanced app) - Creating frontend URLs in backend and vice versa
View backend__config__main.php
<?php
$config = [
'components' => [
// [...]
'request' => [
'baseUrl' => $params['backend.baseUrl'],
],
'urlManagerFrontend' => [
'class' => 'yii\web\UrlManager',
'baseUrl' => $params['frontend.baseUrl'],
@Deele
Deele / CreatingDrupal8Site.md
Created May 10, 2016 12:50
Creating Drupal 8 site
View CreatingDrupal8Site.md
@Deele
Deele / horizontal-bootstrap-activeform-checkbox-view.php
Last active December 3, 2015 11:35
Yii2 Bootstrap ActiveForm horizontal layout checkbox syntax
View horizontal-bootstrap-activeform-checkbox-view.php
<?php
use yii\bootstrap\ActiveForm;
use yii\bootstrap\ActiveField;
$activeField = new ActiveField();
?><div class="tour-form">
<?php $form = ActiveForm::begin(); ?>
<div class="form-horizontal">
<?php
echo <<<HTML
{$form->field(