Skip to content

Instantly share code, notes, and snippets.

View deniscsz's full-sized avatar
🎯
Focusing

Denis Colli Spalenza deniscsz

🎯
Focusing
View GitHub Profile
@deniscsz
deniscsz / php_glob
Created October 24, 2015 13:56 — forked from wooki/php_glob
Util function for a recursive filesearch using glob function
/****************************
*
* Util function for a recursive filesearch using glob function
*
****************************/
if ( ! function_exists('glob_recursive')) {
// Does not support flag GLOB_BRACE
function glob_recursive($pattern, $flags = 0) {
@deniscsz
deniscsz / Lock.php
Created October 15, 2015 20:46 — forked from wcurtis/Lock.php
Magento Lock Model for Preventing Cron Job Overlap
<?php
/**
* Lock manager to ensure our cron doesn't run twice at the same time.
*
* Inspired by the lock mechanism in Mage_Index_Model_Process
*
* Usage:
*
* $lock = Mage::getModel('stcore/cron_lock');
#for Fooman Speedster 2 nginx rewrite rule
location /skin/m/ {
rewrite ^/skin/m/([^/]+)(/.*.(js|css))$ /lib/minify/m.php?f=$2&d=$1;
}