Skip to content

Instantly share code, notes, and snippets.

@BenSampo
BenSampo / deploy.sh
Last active April 2, 2025 09:01
Laravel deploy script
# Change to the project directory
cd $FORGE_SITE_PATH
# Turn on maintenance mode
php artisan down || true
# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
git pull origin $FORGE_SITE_BRANCH
@alooze
alooze / cleanEmptyBlock.plugin.php
Last active December 14, 2015 05:48
MODX Evolution plugin for clean output for HTML blocks with placeholders or another MODX entities.
//<?php
/**
* cleanEmptyBlock plugin for MODX Evo
* @Author: alooze ([email protected])
* @Version: 0.3POC
* @Date: 16.04.2013
* @Event: OnWebPagePrerender
* @Params: &passes=Количество проходов (Passes Count);text;1
*/
<?php
// First fetch all the children of the current resource
$children = $modx->resource->getMany('Children');
// Check if there are any. If not, return false
if (!$children) { return false; }
// Check if there is a tpl set, if not return an error
$tpl = $modx->getOption('tpl',$scriptProperties,'');
if (!$tpl) { return 'No template given.'; }
// Start the output