Skip to content

Instantly share code, notes, and snippets.

@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ć (stjepan.udovicic@inchoo.net)
*/
/** 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;