Skip to content

Instantly share code, notes, and snippets.

View isyan's full-sized avatar

Michael Young isyan

  • Ecommercecanada
  • Canada
View GitHub Profile
@isyan
isyan / mysql-docker.sh
Created October 26, 2016 03:49 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@isyan
isyan / price-updater.php
Created September 24, 2015 01:55
update price
<?php
/**
* @author MagePsycho <[email protected]>
* @website http://www.magepsycho.com
* @category Export / Import
*/
$mageFilename = 'app/Mage.php';
require_once $mageFilename;
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
@isyan
isyan / nodejs_installation_from_source
Created September 12, 2014 10:58
installing Nodejs from source -- make install
wget http://nodejs.org/dist/v0.10.31/node-v0.10.31.tar.gz && tar -xzf node-v0.10.31.tar.gz && cd node-v0.10.31 && make && make install
@isyan
isyan / Web Dev Tools
Last active February 10, 2016 00:43
mysql server
sudo /usr/local/Cellar/mysql/5.6.19/support-files/mysql.server start|stop|restart
To have launchd start mysql at login:
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
Then to load mysql now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
<?php
error_reporting( E_ALL );
require_once 'app/Mage.php';
umask(0);
Mage::app();
$currentWorkingDirectory = getcwd();
if(!file_exists('var/extractedImages')) {
mkdir('var/extractedImages', 0777);
@isyan
isyan / customer-feed.php
Created June 2, 2014 03:42
get customer name and email and prompts for a download as a csv file
<?php
require_once "app/Mage.php";
Mage::app();
header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename=customer-feed.csv');
// create a file pointer connected to the output stream
$output = fopen('php://output', 'w');
<?php
if(!isset($_GET['auth']) || $_GET['auth'] !== '3ebb68a6f75c4c32bd04fe8ed5d76f18') {
header("HTTP/1.1 301 Moved Permanently");
header("Location: /");
header("X-Custom-Message: Please Authenticate");
die();
}
require_once "app/Mage.php";
header("X-Robots-Tag: noindex,nofollow");
@isyan
isyan / Alternate H1
Last active August 29, 2015 14:00 — forked from electricjesus/gist:7a165c651926f02a79d6
add an alternate H1 field in the manage category section
<?php
require_once 'app/Mage.php';
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
$installer = new Mage_Sales_Model_Mysql4_Setup;
$attribute = array(
'type' => 'text',
'label'=> 'Alternate H1',
'input' => 'text',
@isyan
isyan / generic-product-import-script
Created April 9, 2014 15:46
Generic product import script -- compatible with magmi
<?php
error_reporting( E_ALL );
require_once "app/Mage.php";
header("Content-type: application/json; charset=utf-8");
Mage::app();
$fields = array(
"sku","store","type","name",
"description","short_description",
"size","height","weight","color",