Skip to content

Instantly share code, notes, and snippets.

View shanaver's full-sized avatar

Bryan Shanaver shanaver

View GitHub Profile
@shanaver
shanaver / shell
Created February 17, 2011 22:50
test nginx config file - depending on where these files are located
/etc/nginx/sbin/nginx -t -c /etc/nginx/conf/nginx.conf
@shanaver
shanaver / gem
Created February 17, 2011 22:52
installing the mysql gem on Snow Leopard with MAMP - mileage may vary - verify the locations of your respective files first
gem install mysql -- --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config
OR
bundle config build.mysql --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config
@shanaver
shanaver / textmate
Created February 17, 2011 22:52
regular expression in textmate to find lines not containing a strin
^((?!DONT FIND THESE LINES).)*$
@shanaver
shanaver / git
Created February 17, 2011 22:53
git delete remote branch
to delete the remote branch named branch_tobe_deleted:
git push origin :branch_tobe_deleted
to delete your local copy of that branch:
git branch -d branch_tobe_deleted
@shanaver
shanaver / Shell
Created February 17, 2011 22:55
install ntp to keep the time current
apt-get install tzdata
dpkg-reconfigure tzdata
apt-get install ntp
@shanaver
shanaver / gist:832922
Created February 17, 2011 22:55
git - error with commit
if you get the following error:
"You have some suspicious patch lines"
You can either commit again with this added "--no-verify"
or disable the pre-commit hook in your commit file here : .git/hooks/pre-commit
To do this comment out the following line:
if (/\s$/) {
bad_line("trailing whitespace", $_);
}
@shanaver
shanaver / gist:7269023
Created November 1, 2013 17:42
Wordpress htaccess rewrite so you don't have to copy all the live uploads locally for testing
# ----------------------------------------------------------------------
# dev redirect requests for stuff in the uploads dir
# ----------------------------------------------------------------------
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} (/wp-content/uploads/)
RewriteRule ^(.*)$ http://www.website.org/$1 [QSA,L]
@shanaver
shanaver / change_domain.sql
Last active December 27, 2015 04:48
Wordpress domain change entire database for local testing
update wp_posts set guid = replace(guid, "livesite.org", "testsite.local");
update wp_options set option_value = replace(option_value, "livesite.org", "testsite.local");
@shanaver
shanaver / reset.sql
Last active December 27, 2015 04:49
Wordpress: Reset passwords for local testing
UPDATE (wp_users) SET user_pass = MD5('123456');
@shanaver
shanaver / deploy.rb
Created November 19, 2013 23:56
sample capistrano deploy (for a php/wordpress site)
#set :deploy_location, "production"
set :deploy_location, Proc.new { deploy_location = Capistrano::CLI.ui.ask "------------\nEnter deploy location:\n'admin' (default) --> admin.kony2012.com\n'production' --> www.kony2012.com" }
if "#{deploy_location}" == "production"
set :application, "xxxx.us"
set :ip_address, "154.225.148.112"
set :branch, "master"
set :location, "production"
else
set :deploy_location, "staging"