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 | |
App::uses('AppHelper', 'View/Helper'); | |
App::uses('CakeResponse', 'Network'); | |
class NestableHelper extends AppHelper { | |
public function generate($categories, $options = array()){ | |
$this->__options = array_merge( | |
array( |
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
public $actsAs = array('Tree'); | |
public function flattenJsonTree($JSON_array, $iParentId = null, $iLevel = null) | |
{ | |
$aRetval = array(); | |
$iPosition = 1; | |
foreach ($JSON_array as $aChilds) { | |
$aDescendents = array(); | |
if (isset($aChilds['children'])) { | |
$aDescendents = $this->flattenJsonTree( |
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
/** | |
* functions.php | |
* add the svg tags you needs | |
* to the $opts array | |
**/ | |
function override_mce_options($initArray) { | |
$opts = ['svg','g','path']; | |
$initArray['extended_valid_elements'] = $opts; | |
return $initArray; |
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 | |
public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue | |
{ | |
$authentication = new AuthenticationMiddleware($this); | |
$middlewareQueue | |
// Catch any exceptions in the lower layers, | |
// and make an error page/response | |
->add(new ErrorHandlerMiddleware(Configure::read('Error'))) |
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
#!/bin/bash | |
wget https://source.unsplash.com/5120x1440/?wallpaper -O ~/Images/wallpaper.jpg | |
gsettings set org.gnome.desktop.background picture-uri file:///home/$USER/Images/wallpaper.jpg |
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
// The above command will generate about module with about component and add lazy load route at app module for routing about route. | |
ng g m about --module app --route about |