Skip to content

Instantly share code, notes, and snippets.

let translationsContainer = {
data : [],
promise : false,
load: function() {
return new Promise((resolve, reject) => {
if (this.promise) {
# 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
@zandzpider
zandzpider / .htaccess
Created October 16, 2014 13:48
HTML5 History API
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]
$(function() {
$.fn.preload = function() {
this.each(function(){
$('<img/>')[0].src = this;
});
}
// Usage:
<?php
/**
*
* @param string $table
* @param string $field
* @return object
*/
public function enum_select($table, $field)
{
<?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';
// set redirect
Mage::app()->getResponse()->setRedirect($url);
Mage::app()->getResponse()->sendResponse();
Mage::getSingleton('checkout/session')->setNoCartRedirect(true);
<?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(
<?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
));