This file contains hidden or 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 | |
require_once 'google-api-php-client/src/Google_Client.php'; | |
require_once 'google-api-php-client/src/contrib/Google_PlusService.php'; | |
require_once 'google-api-php-client/src/contrib/Google_Oauth2Service.php'; | |
// Set your cached access token. Remember to replace $_SESSION with a | |
// real database or memcached. | |
session_start(); | |
$client = new Google_Client(); |
This file contains hidden or 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
$ip = $_SERVER["REMOTE_ADDR"];//cant use helper, not loaded yet | |
$location = file_get_contents('http://api.ipinfodb.com/v3/ip-city/?key=<api_key>&format=json&ip='.$ip.''); | |
$location = json_decode($location); | |
$country = $location->countryCode; | |
if(strcmp($country,'CA') == 0) { | |
$mageRunType = 'store'; | |
$mageRunCode = 'en_ca'; |
This file contains hidden or 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
mysql> CREATE table temporary_table AS SELECT * FROM core_url_rewrite; | |
mysql> UPDATE temporary_table SET url_rewrite_id = NULL; | |
mysql> UPDATE temporary_table SET store_id = 4; //set the store_id you need to | |
mysql> UPDATE temporary_table SET id_path = UUID(); //create a unique id_path | |
mysql> insert ignore into core_url_rewrite select * from temporary_table; //insert the new records ignoring the ones with conflicts |
This file contains hidden or 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 | |
// Import coupon codes | |
// Thanks go out to Marius Strajeru | |
// Original URL: http://marius-strajeru.blogspot.nl/2010/04/create-bulk-discount-rules.html | |
ini_set('memory_limit', '-1'); | |
require 'app/Mage.php'; | |
Mage::app(); | |
// Import CSV from ViArt format: |
This file contains hidden or 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
#!/usr/bin/env python2 | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
# The author disclaims copyright to this source code. | |
import sys | |
import struct | |
import socket | |
import time | |
import select |
This file contains hidden or 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
find . -path './app/code/core' -prune -o -iname '*php' \! -type d -print0 | xargs -0 grep -il "global/crypt/key" |
This file contains hidden or 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
SELECT email FROM customer_entity as ce JOIN newsletter_subscriber as ns ON ns.subscriber_email = ce.email AND ns.subscriber_status = 1 JOIN sales_flat_order as sfo ON sfo.customer_id = ce.entity_id JOIN sales_flat_order_item as sfoi ON sfo.entity_id = sfoi.order_id JOIN catalog_product_entity as cpe ON cpe.entity_id = sfoi.product_id WHERE cpe.sku !='' group by ce.email; |
This file contains hidden or 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 | |
/* | |
If your products have been deleted but not your media gallery images you | |
can use the following SQL statement to remove these dormant records. | |
Please make sure you backup your installation and database before running this | |
SQL statement. It has been used on Mage 1.8.1 system: | |
DELETE `img` FROM `catalog_product_entity_media_gallery` img |
This file contains hidden or 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
# Installation: | |
# Copy to ~/.config/fish/completions/magento.fish | |
# Open new or restart existing shell session | |
# Commands based on Magento 2.0.0-rc and the command | |
# bin/magento --raw --no-ansi list | |
# It is a static list since you probably do not have the magento shell script | |
# in your path. | |
complete -f -c magento -a --help; | |
complete -f -c magento -a -h; |
This file contains hidden or 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
** SIEGE 3.0.6 | |
** Preparing 500 concurrent users for battle. | |
The server is now under siege... | |
Lifting the server siege...ββββββdone. | |
Transactions:ββββββββββββββββββ39116 hits | |
Availability:ββββββββββββββββ 100.00 % | |
Elapsed time:ββββββββββββββββββ59.44 secs | |
Data transferred:ββββββββββββ 541.05 MB | |
Response time:ββββββββββββββββββ0.26 secs |
OlderNewer