Skip to content

Instantly share code, notes, and snippets.

Avatar

Steve Robbins steverobbins

View GitHub Profile
View magento-mezlan-orders.sql
select
-- count(1) ,
o.entity_id
, o.increment_id
, o.created_at
, o.customer_email order_email
, concat(o.customer_firstname, ' ', o.customer_lastname) order_name
, o.store_name
, ab.region billing_region
, ab.fax billing_fax
@steverobbins
steverobbins / build-static-cache.py
Last active May 3, 2017
Generate static HTML files for a list of urls and the .htaccess rewrite rules for them.
View build-static-cache.py
#!/usr/bin/env python
import os
import urllib2
baseUrl='https://www.thompsontee.com/'
cacheDir='static_cache'
htaccessFile='htaccess'
urls={
@steverobbins
steverobbins / magentoSmartIndexCacheRefresh.sh
Last active Jul 11, 2017
A Magento 1 script that will only reindex and refresh caches that have been invalidated.
View magentoSmartIndexCacheRefresh.sh
#!/bin/bash
# Smart Magento reindexing and cache clearing. Only indexes and caches that are
# invalidate are cleared. Place this file in your shell/ directory and make it
# executable: chmod +x magentoSmartIndexCacheRefresh.sh
#
# Before use it is recommended to consider your failures as a developer due to
# lack of ability to correctly update individual indexes and caches as records
# modified processed.
#
View magento-report.php
<?php
$files = glob('*');
$reports = array();
foreach ($files as $file) {
if (!is_numeric($file)) {
continue;
}
$time = filemtime($file);
View fbl-quotes.sql
select
q.entity_id
, q.created_at
, q.updated_at
, q.base_grand_total
, q.customer_id
, q.customer_email
, q.reserved_order_id
, o.increment_id actual_order_id
from mage_sales_flat_quote q
View plh-mysql-monitor.sh
#!/bin/bash
MYSQL_RUNNING=0
function checkMysql {
/usr/sbin/service mysql status | grep Uptime
if [ "$?" == 0 ]; then
MYSQL_RUNNING=1
fi
}
View ivg-shipment-request.xml
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:microsoft-dynamics-nav/xmlports/x55036" xmlns:ns2="urn:microsoft-dynamics-schemas/codeunit/Malibu">
<SOAP-ENV:Body>
<ns2:ImportShipmentLines>
<ns2:request>
<ns1:ShipmentHdr>
<ns1:NAVOrderNo>1475776983</ns1:NAVOrderNo>
<ns1:MagentoOrderNo>1475776984</ns1:MagentoOrderNo>
<ns1:ShipMethod>USPS</ns1:ShipMethod>
<ns1:ShipAgent>Steve Robbins</ns1:ShipAgent>
<ns1:TrackingNumbers>1234,5678</ns1:TrackingNumbers>
View fbl-shipping-boxes.php
<?php
ini_set('display_errors', 1);
define('MAX_WEIGHT', 25);
$tests = [
[
'input' => [
[
@steverobbins
steverobbins / 00-README.md
Last active Aug 30, 2016
Scripts to set up local Magento 1 environment after importing from prod.
View 00-README.md

mage-local.py

Installation

  • Clone/download of version of zettr that has this commit.
  • Symlink/move the executable/phar to ~/bin/zettr
  • Place mage-local.py inside of ~/bin/ (~/bin/ should already be in your shell $PATH)
  • chmod +x ~/bin/mage-local.py
  • Place mage-local.csv inside of ~/.config/zettr/
View gsf-prepare-table-names.txt
\[Gold Star Foods\$([a-z ]+)\] +(AS )?([a-z0-9]+)
' . table_name('gsf', '$1', '$3') . '
You can’t perform that action at this time.