Skip to content

Instantly share code, notes, and snippets.

View luisfdeandrade's full-sized avatar

Luís Felipe de Andrade luisfdeandrade

View GitHub Profile
<?php
/*
* This scripts changes all occurrences of a URL in your WordPress database.
*
* It will compare the $newUrl against the URL saved on you wp_options table (site_url), or in the domain column of the wp_sites table for a Multi Site installation.
*
* It will handle serialized data and Objects stored in the database.
*
*
*/
@luisfdeandrade
luisfdeandrade / gist:a8a99cb75ce4361ee003
Created February 15, 2016 16:01
Remove big files on GIT
git rev-list --all --objects | \
sed -n $(git rev-list --objects --all | \
cut -f1 -d' ' | \
git cat-file --batch-check | \
grep blob | \
sort -n -k 3 | \
tail -n40 | \
while read hash type size; do
echo -n "-e s/$hash/$size/p ";
done) | \