Skip to content

Instantly share code, notes, and snippets.

@real34
real34 / fix-delete-order-for-taxes.diff
Created June 12, 2013 11:37
Fixed an issue with Magento EM_DeleteOrder module which is not deleting records from the `sales_order_tax` table. This may cause inconsistent generated reports http://www.magentocommerce.com/magento-connect/seamless-delete-order.html
commit e748d3fecd20374624f391603b42d73453db1c6f
Author: Pierre Martin <[email protected]>
Date: Wed Jun 12 12:34:38 2013 +0200
Added sales_order_tax cleaning to the DeleteOrder module to prevent leaving corrupted data
diff --git a/app/code/community/EM/DeleteOrder/controllers/Adminhtml/Sales/OrderController.php b/app/code/community/EM/DeleteOrder/controllers/Adminhtml/Sales/OrderController.php
index a6fbd52..7ca0e45 100644
--- a/app/code/community/EM/DeleteOrder/controllers/Adminhtml/Sales/OrderController.php
+++ b/app/code/community/EM/DeleteOrder/controllers/Adminhtml/Sales/OrderController.php
@real34
real34 / Lemonline_SimpleAdminPayment.csv
Created June 7, 2013 13:43
French Translation for the Simple Admin Payment Magento module
Check / Money Order for Admin Chèque / Liquide pour l'Administrateur
This payment method is enabled only for orders that are created in Magento Admin. Cette méthode de paiement n'est activée que pour les commandes qui sont créées depuis l'Administration
Create and Capture Invoice Automatically Créer et capturer une facture automatiquement
Create Shipment Automatically Créer une expédition automatiquement
@real34
real34 / monitor_slave.js
Created June 6, 2013 10:05
CasperJs script to monitor MySQL replication slave status through PhpMyAdmin. Tested with PhpMyAdmin v3.3.9
var casper = require('casper').create();
var utils = require('utils');
var phpMyAdminUrl = casper.cli.args[0];
var phpMyAdminCredentials = {
pma_username: casper.cli.options.user,
pma_password: casper.cli.options.password
};
if (!phpMyAdminUrl || !phpMyAdminCredentials.pma_username || !phpMyAdminCredentials.pma_password) {
casper.echo('Invalid parameters. Usage: casperjs monitor_slave.js http://example.com/phpMyAdmin --user=foo --password=bar');
@real34
real34 / BugherdHelper.php
Created April 12, 2013 08:53
CakePHP 2.x helper to include in your Controllers to automatically inject Bugherd script in your layouts
<?php
App::uses('Helper', 'View/Helper');
App::uses('File', 'Utility');
class BugherdHelper extends Helper {
public $helpers = array();
private $__bugherdBlacklistedLayouts = array('ajax', 'admin_popup');
# Depends on Occitech's CakePHP capistrano recipe (see https://github.com/occitech/capistrano-recipes)
server "xxxx.yyy.com", :app, :web, :db, :primary => true
set :deploy_to, "/xxx/yyy"
set :branch, "develop"
set :url_base, "http://xxx.occi-tech.com"
set :application, "Croogo"
set :repository, "git@xxx/yyy.git"
set :scm, :git
set :git_enable_submodules, 1
@real34
real34 / version.ctp
Created February 28, 2013 06:36
(Cake)PHP element allowing to display version information from a version.txt file along with revision if deployed with capistrano
<?php
/**
* Displays information about the current version of the application
*/
$basePath = ROOT . DS;
$appVersion = array_fill_keys(array('version', 'revision', 'timestamp'), '');
if (file_exists($basePath . 'version.txt')) {
$appVersion['timestamp'] = filemtime($basePath . 'version.txt');
$appVersion['version'] = file($basePath . 'version.txt');
@real34
real34 / OccitechCakeTestCase.php
Last active December 10, 2015 13:59
Extended CakePHP test case class with convenience methods
<?php
App::uses('ControllerTestCase', 'TestSuite');
/**
* Occitech custom Test Library.
* Extends core librairy to add convenience methods.
*/
abstract class OccitechCakeTestCase extends ControllerTestCase {
protected $fixtures = array();
@real34
real34 / .htaccess
Last active December 10, 2015 00:29
Page de maintenance simple et configurable avec .htaccess pour rediriger vers elle
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
# RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.123 # Allowed IP
RewriteCond %{REQUEST_URI} !^/maintenance.php [NC]
RewriteRule .* /maintenance.php [L]
@real34
real34 / mysql_backup.sh
Created December 11, 2012 14:50
SHELL script to backup all MySQL databases
#!/bin/bash
### MySQL Server Login Info ###
MUSER="root"
MPASS="xxxx"
MHOST="localhost"
MYSQL="/usr/local/bin/mysql"
MYSQLDUMP="/usr/local/mysql/bin/mysqldump"
BACKUP_PATH="/data/backup/mysql"
GZIP="/bin/gzip"
@real34
real34 / browser_update.js
Last active October 12, 2015 14:18
Javascript : script to include for displaying a notification to users having an old browser. Based on top of http://www.browser-update.org/
/**
* Generic script for displaying a "Browser outdated" message to users
* Displays an overlay and a message including the Chrome Frame
*
* @see http://www.browser-update.org/fr/
*/
var $buoop = {
reminder: 168,
newwindow: true,