Skip to content

Instantly share code, notes, and snippets.

View lnoering's full-sized avatar

Leonardo Noering lnoering

View GitHub Profile
@piotrekkaminski
piotrekkaminski / MPERF-10565.diff
Created April 8, 2019 18:04
MPERF-10565.diff - logging to a file that does not exist issue
diff --git a/app/Mage.php b/app/Mage.php
index 0e650eebb4f..9c18e222689 100644
--- a/app/Mage.php
+++ b/app/Mage.php
@@ -798,9 +798,9 @@ public static function log($message, $level = null, $file = '', $forceLog = fals
',',
(string) self::getConfig()->getNode('dev/log/allowedFileExtensions', Mage_Core_Model_Store::DEFAULT_CODE)
);
- $logValidator = new Zend_Validate_File_Extension($_allowedFileExtensions);
$logDir = self::getBaseDir('var') . DS . 'log';
@coinsandsteeldev
coinsandsteeldev / dialog.html
Last active July 19, 2024 05:46 — forked from arthurattwell/dialog.html
Google Sheets script to allow multi-select in cells with data-validation (adapted from https://www.youtube.com/watch?v=dm4z9l26O0I)
<!DOCTYPE html>
<html>
<head>
<script>
var data
var formId = 'form'
function drawForm() {
if (!data) return
var outputEl = document.getElementById(formId);
@sergiojovanig
sergiojovanig / magento2-clear.sql
Last active January 15, 2024 12:25
Magento 2 Clear Database
##########################################################
# PRODUCTS
##########################################################
DELETE FROM `catalog_product_bundle_option`;
DELETE FROM `catalog_product_bundle_option_value`;
DELETE FROM `catalog_product_bundle_selection`;
DELETE FROM `catalog_product_entity_datetime`;
DELETE FROM `catalog_product_entity_decimal`;
DELETE FROM `catalog_product_entity_gallery`;
DELETE FROM `catalog_product_entity_int`;
@telmofcosta
telmofcosta / backup-restore sdcard
Created February 8, 2015 12:16
Backup and restore an SD card on Mac OS x (perfect for Raspberry Pi)
# insert SD and find out where it is mounted
diskutil list
# /dev/disk0
# #: TYPE NAME SIZE IDENTIFIER
# 0: GUID_partition_scheme *250.1 GB disk0
# ...
# /dev/disk1
# #: TYPE NAME SIZE IDENTIFIER
# 0: FDisk_partition_scheme *15.7 GB disk1
# ...
@ivanseidel
ivanseidel / PID.ino
Last active March 29, 2024 07:15
Simple PID Class for Arduino Projects
// (Really Simple) PID Class by Ivan Seidel
// GitHub.com/ivanseidel
// Use as you want. Leave credits
class PID{
public:
double error;
double sample;
double lastSample;
@claudiu-marginean
claudiu-marginean / Magento-Snippets-Claudiu.md
Last active July 6, 2021 08:54
Magento Snippets - Claudiu

Magento Snippets

Code snippets from different sections of Magento that are very useful.

JS Translation in phtml files

<script>
//<![CDATA[
Translator.add(
    <?php echo Mage::helper('core')->jsonEncode(array(
@leek
leek / WritingMagentoModules.md
Created July 8, 2013 21:51
Writing Modules for Magento 1.x

Writing Magento Modules

All custom modules should have a Namespace and Module Name. These are used below as {Namespace} and {Module}.

Caution: The Magento autoloader is known to have problems with CamelCase namespaces and/or modules between Windows and *nix systems. If your module requires more than one word for either of these, it is best to just concatenate them to avoid any issues (Example: {Namespace}_{Examplemodule}).

Index

@hans2103
hans2103 / robots.txt
Last active December 7, 2016 23:40
Magento robots.txt as published on our Byte blog Magento Robots.txt [http://www.byte.nl/blog/magento-robots-txt/]
# $Id: robots.txt,v magento-specific 2010/28/01 18:24:19 goba Exp $
# Edited: 2014/10/30 by Byte.nl
#
# robots.txt
#
# This file is to prevent the crawling and indexing of certain parts
# of your site by web crawlers and spiders run by sites like Yahoo!
# and Google. By telling these “robots” where not to go on your site,
# you save bandwidth and server resources.
#
@corny
corny / install_zend_guard.sh
Created April 3, 2013 14:16
Installation of Zend Guard 5.5.0 using PHP 5.3 and Ubuntu 12.04 (64 bit).
#!/bin/bash
cd /root
wget http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz
tar xzf ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz
cp ZendGuardLoader-php-5.3-linux-glibc23-x86_64/php-5.3.x/ZendGuardLoader.so /usr/lib/php5/20090626/
file=/usr/lib/php5/20090626/ZendGuardLoader.so
echo zend_extension=$file > /etc/php5/conf.d/zend_extensions.ini
chmod 644 $file
@molotovbliss
molotovbliss / gist:2562551
Last active September 7, 2022 20:18 — forked from davidalexander/gist:1086455
Magento Snippets

Magento Snippets

Set all categories to is_anchor 1

Find attribute_id

SELECT * FROM eav_attribute where attribute_code = 'is_anchor'

Update all of them with anchor_id from above (usually is ID 51)

UPDATE `catalog_category_entity_int` set value = 1 where attribute_id = 51