Skip to content

Instantly share code, notes, and snippets.

View joshuaadrian's full-sized avatar

Joshua Adrian joshuaadrian

View GitHub Profile
<?php
/**
*
* Safe Search and Replace on Database with Serialized Data v2.1.1
*
* This script is to solve the problem of doing database search and replace when
* developers have only gone and used the non-relational concept of serializing
* PHP arrays into single database columns. It will search for all matching
* data on the database and change it, even if it's within a serialized PHP
* array.
RewriteRule ^this/that\.html$ http://www.something.com/that/ [R=301,L]
mysqldump -u username -h localhost --no-data -p database_name > database_dump_name.sql
mysqldump -u username -h localhost --skip-triggers --compact --no-create-info database_name > database_dump_name.sql -p
RewriteBase /
RewriteCond %{HTTP_HOST} !oldexample.com$ [NC]
RewriteRule ^(.*)$ http://newexample.com/$1 [L,R=301]
@joshuaadrian
joshuaadrian / Bash Profile
Created September 5, 2013 13:47
Colored Bash profile with git/hg branch names. Place in your .bash_profile file.
export TERM=xterm-256color
DEFAULT=$"\e[38;5;247m"
PINK=$"\e[38;5;163m"
GREEN=$"\e[38;5;76m"
ORANGE=$"\e[38;5;208m"
RED=$"\e[38;5;160m"
BLUE=$"\e[38;5;26m"
parse_git_branch() {