Skip to content

Instantly share code, notes, and snippets.

<IfModule php5_module>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
<IfModule dir_module>
DirectoryIndex x index.html index.php index.cfm
</IfModule>
</IfModule>
[alias]
co = checkout
st = status
ci = commit
br = branch
df = diff
lg = log -p
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
ls = ls-files
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 / tar_mage_directory.sh
Last active December 24, 2019 10:48
Magento Tar Directory Script
#!/bin/bash
echo "////////////////////////// MAGENTO TAR ////////////////////////////"
date
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
excludefilename="$DIR/exclude_files.txt"
day=$(date +%A)
path=$1