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 / baseHtml.js
Created Jan 7, 2015
Port of Yii2 BaseHtml class that provides a set of static methods for generating commonly used HTML tags
View baseHtml.js
* Returns whether given variable is undefined
* @author Nils Lindentals <>
* @license GNU GPL v2.0
* @param variable
* @returns {boolean}
function isUndefined(variable) {
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 / horizontal-bootstrap-activeform-checkbox-view.php
Last active Dec 3, 2015
Yii2 Bootstrap ActiveForm horizontal layout checkbox syntax
View horizontal-bootstrap-activeform-checkbox-view.php
use yii\bootstrap\ActiveForm;
use yii\bootstrap\ActiveField;
$activeField = new ActiveField();
?><div class="tour-form">
<?php $form = ActiveForm::begin(); ?>
<div class="form-horizontal">
echo <<<HTML
Deele /
Created May 10, 2016
Creating Drupal 8 site
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 / 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 / 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 / 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 / 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 /
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
You can’t perform that action at this time.