Skip to content

Instantly share code, notes, and snippets.

@udovicic
udovicic / table_cleaning.sql
Created September 27, 2015 10:50
Magento extra table flush
SET foreign_key_checks = 0;
TRUNCATE `core_cache_option`;
TRUNCATE `core_cache_tag`;
TRUNCATE `core_session`;
TRUNCATE `dataflow_batch_export`;
TRUNCATE `dataflow_batch_import`;
TRUNCATE `enterprise_logging_event`;
TRUNCATE `enterprise_logging_event_changes`;
TRUNCATE `enterprise_support_backup`;
TRUNCATE `enterprise_support_backup_item`;
@udovicic
udovicic / update.php
Created January 21, 2015 10:06
Script for triggering module updates and cache refresh for Magento EE
<?php
/**
* Upgrade script based on https://gist.github.com/colinmollenhour/2715268
* Set global/skip_process_modules_updates to '1' in app/etc/local.xml
*
* Execute script to trigger upgrades and cache refresh
*/
require_once 'abstract.php';
@udovicic
udovicic / nginx.conf
Created January 15, 2015 08:57
nginx configuration for Sendy
upstream sendybackend {
server unix:/var/run/php-fcgi-sendy.sock;
}
server{
listen {server_ip}:80;
server_name sendy.{domain};
autoindex off;
@udovicic
udovicic / sendmail.php
Created January 12, 2015 12:10
Fake sendmail - write content to file
#!/usr/bin/php
<?php
/**
* Fake mail sending: log content to file
*
* Instructions:
* 1. Save as /usr/sbin/sendmail
* 2. Make it executable
*/
<?php
/**
* Using PHP syntax, partition the array A into two arrays B and C in a way that that the difference between the
* sum of elements in B and the sum of elements in C is minimized.
*
* @author Stjepan Udovičić ([email protected])
*/
/** Predefined array */
$A = array(
/* Test IBAN values:
HR 15 2340 0093 2109 5545 7
HR 5023400093102278840
*/
#include <iostream>
#include <string>
#include <algorithm> // needed for remove_if
using namespace std;