Skip to content

Instantly share code, notes, and snippets.

location /api {
rewrite ^/api/rest /api.php?type=rest last;
rewrite ^/api/v2_soap /api.php?type=v2_soap last;
rewrite ^/api/soap /api.php?type=soap last;
}
COUNTRIES_WITHOUT_POSTCODES = [
[ "Angola", "AO" ],
[ "Antigua and Barbuda", "AG" ],
[ "Aruba", "AW" ],
[ "Bahamas", "BS" ],
[ "Belize", "BZ" ],
[ "Benin", "BJ" ],
[ "Botswana", "BW" ],
[ "Burkina Faso", "BF" ],
[ "Burundi", "BI" ],
delimiter ;;
drop procedure if exists build_catalog;;
create procedure build_catalog(IN categories INT, IN products INT)
begin
SET @category_count = 1;
SET @CATNAMEPREFIX = "Category ";
SET @CATURLKEYPREFIX = "cat-";
SET @CATURLPATHPREFIX = "catpath-";
SET @ROOTCATEGORY = 2;
SET @INCLUDEINMENU = 1;
@Kamik
Kamik / gist:39034717a664e2f70731
Last active August 29, 2015 14:07
magento countries without post codes / with optional zip
UPDATE `core_config_data` SET `value` = 'AO,AG,GQ,AW,BS,BZ,BJ,BW,BF,BI,CK,CI,CD,KP,DM,DJ,ER,FJ,TF,GM,GH,GD,GN,GY,IE,YE,CM,QA,KI,KM,CG,MW,ML,MR,NR,NU,TL,SB,ST,SC,SL,ZW,SO,HK,MO,KN,LC,SR,SY,TZ,TG,TK,TO,TV,UG,VU,AE,CF' WHERE `scope` = 'default' and `scope_id`=0 and `path` = 'general/country/optional_zip_countries'
# use this inside lib/Zend to make the version of ZF usable with php 5.6
sed -i "s/'internal_encoding'/'default_charset'/g" ./XmlRpc/Client.php ./Service/Audioscrobbler.php ./Service/Technorati.php ./Locale/Format.php ./Validate/Hostname.php ./Validate/StringLength.php
@Kamik
Kamik / shell_delete_unused_images
Created April 8, 2016 17:31 — forked from aleron75/shell_delete_unused_images
Delete no more used Product Images on Magento
<?php
require_once 'abstract.php';
class Mage_Shell_CheckImages extends Mage_Shell_Abstract
{
const CATALOG_PRODUCT = '/catalog/product';
const CACHE = '/cache/';
protected function _glob_recursive($pattern, $flags = 0)
@Kamik
Kamik / n98-magerun.yaml
Created April 11, 2016 09:49 — forked from paales/n98-magerun.yaml
Export a Magento database without the products or without the categories, place this file in app/etc/. Docs about creating a custom dump command: https://github.com/netz98/n98-magerun/wiki/Stripped-Database-Dumps
commands:
N98\Magento\Command\Database\DumpCommand:
table-groups:
- id: products
description: Skip all product tables.
tables: >
catalog_category_product*
catalog_compare_item
catalog_product_*
cataloginventory_stock_*
@Kamik
Kamik / mysql_splitdump.sh
Created May 27, 2016 06:32 — forked from jasny/mysql_splitdump.sh
Split MySQL dump SQL file into one file per table or extract a single table
#!/bin/bash
####
# Split MySQL dump SQL file into one file per table
# based on http://blog.tty.nl/2011/12/28/splitting-a-database-dump
####
if [ $# -lt 1 ] ; then
echo "USAGE $0 DUMP_FILE [TABLE]"
exit
@Kamik
Kamik / prestashop.conf
Created August 10, 2017 12:11 — forked from julienbourdeau/prestashop.conf
PrestaShop Nginx Configuration
server {
listen 80;
listen [::]:80; #Use this to enable IPv6
server_name www.example.com;
root /var/www/prestashop17;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
index index.php index.html;
@Kamik
Kamik / interfaces
Created July 10, 2019 22:38 — forked from hazanjon/interfaces
Hetnzer Network Interface settings for Proxmox and pfSense
### Hetzner Online AG - installimage
# Loopback device:
auto lo
iface lo inet loopback
# device: eth0
auto eth0 ##Hetzner Interface
iface eth0 inet static
address <Main IP>
broadcast <Broadcast IP>