This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let translationsContainer = { | |
data : [], | |
promise : false, | |
load: function() { | |
return new Promise((resolve, reject) => { | |
if (this.promise) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Register All Of The Configured Shared Folders | |
settings["folders"].each do |folder| | |
config.vm.synced_folder folder["map"], folder["to"], type: folder["type"] ||= nil,:nfs => true, | |
:mount_options => ['nolock,vers=3,udp,noatime,actimeo=2'] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
# Don't rewrite files or directories | |
RewriteCond %{REQUEST_FILENAME} -f [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^ - [L] | |
# Rewrite everything else to index.html to allow html5 state links | |
RewriteRule ^ index.html [L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
$.fn.preload = function() { | |
this.each(function(){ | |
$('<img/>')[0].src = this; | |
}); | |
} | |
// Usage: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* @param string $table | |
* @param string $field | |
* @return object | |
*/ | |
public function enum_select($table, $field) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* https://gist.github.com/andergmartins/5066143 | |
* From: http://abhinavsingh.com/blog/2009/12/how-to-use-locks-in-php-cron-jobs-to-avoid-cron-overlaps/ | |
*/ | |
class CronHelper | |
{ | |
const LOCK_DIR = '/tmp/'; | |
const LOCK_SUFFIX = '.lock'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set redirect | |
Mage::app()->getResponse()->setRedirect($url); | |
Mage::app()->getResponse()->sendResponse(); | |
Mage::getSingleton('checkout/session')->setNoCartRedirect(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$installer = $this; | |
$installer->startSetup(); | |
for ($i = 2015; $i <= 2020; $i++) | |
{ | |
$setup = Mage::getModel('customer/entity_setup', 'core_setup'); | |
$setup->addAttribute('customer', "kid_$i", array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function isSalable() | |
{ | |
//function modified to store answers in the magento registry | |
if (is_null(Mage::registry('isSaleable' . $this->getId()))) | |
{ | |
Mage::dispatchEvent('catalog_product_is_salable_before', array( | |
'product' => $this | |
)); |