Skip to content

Instantly share code, notes, and snippets.

Using Git to Manage a Live Web Site

###Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

####Contents

@dannygsmith
dannygsmith / php-openssl.md
Created August 30, 2017 03:32 — forked from ryanscherler/php-openssl.md
Use Homebrew PHP with OpenSSL instead of SecureTransport
@dannygsmith
dannygsmith / php_upgrade_to_71.sh
Created August 30, 2017 16:33 — forked from pixeline/php_upgrade_to_71.sh
Update Mac Os X's php version to php 7.1 using homebrew. Includes curl and mcrypt
# 1. Install brew --> http://brew.sh/
# 2. run the following commands in your Terminal
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install --with-openssl curl
brew install --with-homebrew-curl --with-apache php71
brew install php71-mcrypt php71-imagick
# 3. Follow these instructions to make Apache and php-cli use the newer php executable and make the change persist after reboot.
brew info php71
@dannygsmith
dannygsmith / to-utf8
Created August 31, 2017 02:02
Convert database to utf8 utf8_general_ci
DB="dbname"
(
echo 'ALTER DATABASE `'"$DB"'` CHARACTER SET utf8 COLLATE utf8_general_ci;'
mysql "$DB" -e "SHOW TABLES" --batch --skip-column-names \
| xargs -I{} echo 'ALTER TABLE `'{}'` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;'
) \
| mysql "$DB"
@dannygsmith
dannygsmith / valet-plus-install
Last active September 29, 2021 12:48
Install valet-plus
#!/usr/bin/env bash
#styles
VP_NONE='\033[00m'
VP_RED='\033[01;31m'
VP_GREEN='\033[01;32m'
VP_YELLOW='\033[01;33m'
VP_PURPLE='\033[01;35m'
VP_CYAN='\033[01;36m'
VP_WHITE='\033[01;37m'
@dannygsmith
dannygsmith / valet-plus-destroy
Last active July 18, 2023 09:07
Remove valet-plus - reboot required
#!/usr/bin/env bash
#styles
VP_NONE='\033[00m'
VP_RED='\033[01;31m'
VP_GREEN='\033[01;32m'
VP_YELLOW='\033[01;33m'
VP_PURPLE='\033[01;35m'
VP_CYAN='\033[01;36m'
VP_WHITE='\033[01;37m'
@dannygsmith
dannygsmith / valet-list
Last active June 10, 2019 15:51
List all valet-plus process's
#!/usr/bin/env bash
#styles
VP_NONE='\033[00m'
VP_RED='\033[01;31m'
VP_GREEN='\033[01;32m'
VP_YELLOW='\033[01;33m'
VP_PURPLE='\033[01;35m'
VP_CYAN='\033[01;36m'
VP_WHITE='\033[01;37m'
@dannygsmith
dannygsmith / wp-db-backup
Last active October 3, 2017 18:54
backup all valet-plus databases
#!/usr/bin/env bash
export PATH="/usr/local/bin:$PATH";
SUFFIX=`date "+%w"`
readarray arr < /Users/riskiii/bin/hosts.txt
## now loop through the above array
for k in "${arr[@]}"
do
@dannygsmith
dannygsmith / wp-db-restore
Last active December 13, 2017 03:47
Restore all WordPress databases in laravel valet
#!/usr/bin/env bash
SUFFIX=`date "+%w"`
#styles
VP_NONE='\033[00m'
VP_RED='\033[01;31m'
VP_GREEN='\033[01;32m'
VP_YELLOW='\033[01;33m'
VP_PURPLE='\033[01;35m'
blueprint
wp_mai
wp_material
wp_oopsandbox
wp_sample
wp_susy-starter
wp_tabber