Skip to content

Instantly share code, notes, and snippets.

@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 / Fragment
Created December 28, 2017 03:05
Setting up a Mac for development
# Homebrew and Cask
Install the XCode command line tools by running `xcode-select --install` in the terminal.
Install Homebrew by following the instructions on the [homebrew website](http://brew.sh).
Install Cask by following the instructions on the [cask website](https://caskroom.github.io).
# Applications
@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-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'
DB="your_database_name"
USER="your_db_user"
PASS="your_db_pass"
HOST="database_hostname"
(
echo 'ALTER DATABASE `'"$DB"'` CHARACTER SET utf8 COLLATE utf8_general_ci;'
mysql -p $PASS -u $USER -h $HOST "$DB" -e "SHOW TABLES" --batch --skip-column-names \
| xargs -I{} echo 'ALTER TABLE `'{}'` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;'
) \
| mysql -p $PASS -u $USER -h $HOST "$DB"
@dannygsmith
dannygsmith / convert.php
Created April 21, 2019 02:24 — forked from WPEtopher/convert.php
A script for converting MySQL databases to UTF8 (tables and columns).
/*
Plugin Name: Convert WP Database to UTF-8
Plugin URI: http://topher.wpengine.com/
Description: Converts the WordPress database (both tables and columns) to UTF-8 character set.
Version: 1.1.0
Author: Topher Hota (@WPEtopher), Yihui Xie
Author URI: http://yihui.name
*/
/*

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 / wp-create
Last active December 29, 2018 09:56
Script to create new WordPress Site
#!/usr/bin/env bash
export HOME="/Users/john"
#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'
@dannygsmith
dannygsmith / install-files
Last active April 23, 2018 19:50
Install all of the files for valet etc.
#!/usr/bin/env bash
SCRIPTS="bin"
#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'
@dannygsmith
dannygsmith / gist:d7b547f1fe3b318cebce8a657d9a6577
Last active March 29, 2018 17:37
Install Non Wordpress Sandbox
git clone https://github.com/KnowTheCode/Non-WordPress-Sandbox .
composer install