Skip to content

Instantly share code, notes, and snippets.

View herooutoftime's full-sized avatar

Andreas Bilz herooutoftime

  • Content Garden
  • Vienna, Austria
View GitHub Profile
@Mark-H
Mark-H / snippet.php
Created May 7, 2012 14:47
MODX Snippet to take a database backup and to email that.
<?php
$mailto = (isset($mailto)) ? $mailto : '@@ DEFAULT EMAIL HERE @@';
$warningMail = '@@ EMAIL TO SEND WARNING TO IN CASE OF A SMALL BACKUP FILE @@';
include MODX_CORE_PATH.'/config/'.MODX_CONFIG_KEY.'.inc.php';
$host = $database_server; // database host
$dbuser = $database_user; // database user name
$dbpswd = $database_password; // database password
$mysqldb = $dbase; // name of database
@arosenhagen
arosenhagen / magento-code-snippets.md
Last active April 8, 2024 09:21
[magento] - code snippets

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name
@barockok
barockok / Premailer.php
Created January 10, 2012 20:39 — forked from Synchro/Premailer.php
PHP interface class for the Premailer API
<?php
/**
* Premailer API PHP class
* Premailer is a library/service for making HTML more palatable for various inept email clients, in particular GMail
* Primary function is to convert style tags into equivalent inline styles so styling can survive <head> tag removal
* Premailer is owned by Dialect Communications group
* @link http://premailer.dialect.ca/api
* @author Marcus Bointon <marcus@synchromedia.co.uk>
*/
<?php
if ($modx->event->name == 'OnManagerPageInit') {
$script = <<<SCRIPT
<script type="text/javascript">
Ext.ComponentMgr.onAvailable('modx-panel-resource', function(){
Ext.getCmp('modx-panel-resource').on('ready', function(){
window.setTimeout(function(){Ext.getCmp('modx-panel-resource').markDirty()}, 250);
})
})
</script>