This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns whether given variable is undefined | |
* | |
* @author Nils Lindentals <nils@dfworks.lv> | |
* @license GNU GPL v2.0 | |
* | |
* @param variable | |
* @returns {boolean} | |
*/ | |
function isUndefined(variable) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<div id="result"></div> | |
<script> | |
if (typeof(EventSource) !== 'undefined') { | |
console.info('Starting connection...'); | |
var source = new EventSource('/stream.php'); | |
source.addEventListener('open', function(e) { | |
console.info('Connection was opened.'); | |
}, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$config = [ | |
'components' => [ | |
// [...] | |
'request' => [ | |
'baseUrl' => $params['backend.baseUrl'], | |
], | |
'urlManagerFrontend' => [ | |
'class' => 'yii\web\UrlManager', | |
'baseUrl' => $params['frontend.baseUrl'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {object} settings | |
* @param {object} options | |
* @returns {object} | |
*/ | |
function updateSettings(settings, options) { | |
var updatedSettings = {}; | |
if (typeof settings !== 'undefined') { | |
Object.assign(updatedSettings, settings); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
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 |
OlderNewer