Skip to content

Instantly share code, notes, and snippets.

Nils Deele

Block or report user

Report or block Deele

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Deele / backend__config__main.php
Last active Nov 9, 2019
Yii2 (advanced app) - Creating frontend URLs in backend and vice versa
View backend__config__main.php
$config = [
'components' => [
// [...]
'request' => [
'baseUrl' => $params['backend.baseUrl'],
'urlManagerFrontend' => [
'class' => 'yii\web\UrlManager',
'baseUrl' => $params['frontend.baseUrl'],
Deele / mail_tester.php
Last active Nov 4, 2019
Mail sending tester via Sfiftmailer (originally made for use with `drupal/swiftmailer` and `drupal/smtp` composer packages installed)
View mail_tester.php
ini_set('display_errors', 1);
$autoloadPath = 'autoload.php';
if (!file_exists($autoloadPath)) {
$autoloadPath = '../' . $autoloadPath;
if (!file_exists($autoloadPath)) {
$autoloadPath = '../' . $autoloadPath;
Deele /
Last active Aug 21, 2019
Create backup archive of Drupal project files
# Settings
# Begin
Deele /
Last active Apr 5, 2019 — forked from TylerFisher/
Google Spreadsheets script to generate transliterated slugs from a range of cells

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 / ContentEntityMigrationTool.php
Created Mar 14, 2019
Drupal 8 Content Entity Migration Tool
View ContentEntityMigrationTool.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 / updateSettings.js
Last active Jun 6, 2018
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 / sse.html
Last active Mar 2, 2018
Server-Sent Events example, Javascript client-side, PHP server-side
View sse.html
<div id="result"></div>
if (typeof(EventSource) !== 'undefined') {'Starting connection...');
var source = new EventSource('/stream.php');
source.addEventListener('open', function(e) {'Connection was opened.');
}, false);
Deele / duplicateIdsMonitoring.js
Last active Sep 4, 2017
Monitors document body for duplicate IDs and warns in console when that happens (potential for chrome extension)
View duplicateIdsMonitoring.js
(function (window) {
// Based on
window.observeDOM = (function () {
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver,
eventListenerSupported = window.addEventListener;
return function (obj, callback) {
if (MutationObserver) {
// define a new observer
Deele / TinyMce.php
Last active Jul 28, 2017
Implemented an option to call widget initialization on demand (for PJAX, AJAX or other purposes).
View TinyMce.php
* @copyright Copyright (c) 2013-2017 2amigOS! Consulting Group LLC
* @link
* @license New BSD License
namespace dosamigos\tinymce;
use yii\helpers\Html;
use yii\helpers\Json;
Deele /
Created May 10, 2016
Creating Drupal 8 site
You can’t perform that action at this time.