Skip to content

Instantly share code, notes, and snippets.

Tory Burch Abitha Flip Flops These leather <a style=""text-decoration:none;"" href=""/tory-burch-shoes-sandals-all/br/v=1/2534374302075716.htm"">Tory Burch sandals</a>
> db.products.findOne({sourceid: 'INDAH40160'})
{
"_id" : ObjectId("52f3d868b4932d0fc100218b"),
"brandname" : "Indah",
"categories" : [
"Apparel",
"Womens",
"Dresses",
"Day"
],
@steve-ross
steve-ross / gist:9763322
Created March 25, 2014 14:47
mage get all ids
$ids = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToSelect('entity_id')
->addFieldToFilter('status', array('eq'=>'1'))
->addFieldToFilter('type_id', array('in'=>array('configurable', 'simple')))
->getAllIds();
function _git_branch_name
echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end
function _is_git_dirty
echo (git status -s --ignore-submodules=dirty ^/dev/null)
end
function _unpushed
@steve-ross
steve-ross / gist:9956896
Last active August 29, 2015 13:58
Mage, getting standard db connection
// instead of the following:
// db variables
$dsn = 'the dsn hard coded';
$username = 'username hard coded';
$password = 'password hard coded';
// try to connect to the db
try {
$db = new PDO($dsn, $username, $password);
@steve-ross
steve-ross / gist:9957350
Last active August 29, 2015 13:58
helpers
$j(document).ready(function () {
// enable strict mode
'use strict';
// hide the site newsletter modal
$j('.signup-form').hide();
var check_url = 'http://' + host + '/skin/frontend/enterprise/rebeccaminkoff/inc/sanity-check.php';
var save_url = 'http://' + host + '/skin/frontend/enterprise/rebeccaminkoff/inc/store-address.php';
function get_newsletter_signup_data(){
@steve-ross
steve-ross / mysql_dump_mage.sh
Created April 3, 2014 16:50
Mysql Dump Magento DB script
#!/bin/bash
echo "////////////////////////// START ////////////////////////////"
date
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
day=$(date +%A)
user=$2
host=$1
database=$3
@steve-ross
steve-ross / signup.js
Created April 14, 2014 13:58
signup form changes
$j(document).ready(function () {
// enable strict mode
'use strict';
// hide the site newsletter modal
$j('.signup-form').hide();
$j('.footer .last a').attr('onclick', ''); // remove the newsletter click event
$j('.discount-modal').remove();
var pathArray = window.location.href.split('/');
var host = pathArray[2];
<?php
define('__CURRENTDIR__', dirname(dirname(__FILE__)));
define('__MAGE__', str_replace('/code/local/GaugeInteractive/EbayMipIntegration', '/Mage.php', __CURRENTDIR__));
require_once(__MAGE__);
Mage::app('default');
Mage::register('isSecureArea', 1);
module.exports = function(grunt) {
var target = grunt.option('target') || 'dev';
var watch_tasks = ['concat:js'];
if(target != 'dev') watch_tasks.push('uglify:js');
grunt.registerTask('watch', [ 'watch' ]);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),