Skip to content

Instantly share code, notes, and snippets.

View carlowens's full-sized avatar

Carl Owens carlowens

View GitHub Profile
@carlowens
carlowens / gist:7386157
Created November 9, 2013 14:39
Remove customer data, sales data and logs from Magento database
SET FOREIGN_KEY_CHECKS=0;
-- Here's where we reset the orders
TRUNCATE `sales_flat_order`;
TRUNCATE `sales_flat_order_address`;
TRUNCATE `sales_flat_order_grid`;
TRUNCATE `sales_flat_order_item`;
TRUNCATE `sales_flat_order_status_history`;
TRUNCATE `sales_flat_quote`;
TRUNCATE `sales_flat_quote_address`;
@carlowens
carlowens / track-branches.sh
Last active July 16, 2019 05:26
track all remote branches from github
#!/bin/bash
echo "Tracking all remote branches"
for remote in `git branch -r | sed "s/origin\///g"`;
do git branch --track $remote origin/$remote;
done
@carlowens
carlowens / remove-branches.sh
Created June 4, 2013 16:10
Delete unwanted git branches from remote
#!/bin/bash
echo "Deleting remote branches contained within to-be-deleted-branches.txt"
while read BRANCH_NAME
do
echo -e "$BRANCH_NAME \n"
if [ ! -L "${BRANCH_NAME}" ]; then
git push origin --delete $BRANCH_NAME
fi
done < to-be-deleted-branches.txt