Skip to content

Instantly share code, notes, and snippets.

@newloong
newloong / Trellis setup
Created January 27, 2018 10:04 — forked from jasperf/Trellis setup
Bash script to setup Bedrock, Trellis and Sage #Roots
#!/bin/bash
# set this variable - it will be used as both the root folder name and the theme name for sage
# no spaces - should not be a URL - I'm using 'my-site' or similar
SITENAME="your-site-name"
# Add BitBucket username/password to have a remote repo setup
BBUSER="YOUR-BB-USERNAME"
BBPASS="YOUR-BB-PASSWORD"
@newloong
newloong / create-wp-site.sh
Created January 27, 2018 10:08 — forked from matgargano/create-wp-site.sh
create a sample wordpress site with trellis
#!/bin/bash
DOT_FILE="$HOME/.wordpress-base"
SITE_REPO="git@github.com:matgargano/bedrock.git"
TRELLIS_REPO="git@github.com:roots/trellis.git"
MULTISITE_DOCUMENTATION_URL="https://roots.io/trellis/docs/multisite/"
TRELLIS_DOCUMENTATION_URL="https://roots.io/trellis/"
LANDRUSH_ISSUE_URL="https://github.com/mitchellh/vagrant/issues/4918"
@newloong
newloong / bubble.sh
Created January 27, 2018 10:12 — forked from omargourari/bubble.sh
Bubble
################################################################################
# BUBBLE - Trellis/Bedrock/Sage automation script
# 1. Get the domain variable from the final website url
# 2. Check and install the bubble requirements
# 2.1 Check if Homebrew is installed
# 2.2 Check if Ansible is installed
# 2.3 Check if Virtualbox is installed
# 2.4 Check if Vagrant is installed
@newloong
newloong / bedrock-and-trellis.md
Created January 27, 2018 10:14
This is a script designed to streamline the process of setting up and WordPress installation with the help of Bedrock (https://roots.io/bedrock/) and Trellis (https://roots.io/trellis/)

WP Setup

This is a script designed to streamline the process of setting up and WordPress installation with the help of Bedrock and Trellis

To run, copy this script where you want you would like to create the project and run:

chmod -x setup-wp.sh && setup-wp.sh

Dependancies

@newloong
newloong / bedrock-ansible-setup.sh
Created January 29, 2018 10:23 — forked from rstormsf/bedrock-ansible-setup.sh
Bedrock ansible setup
#!/bin/bash
#Script to install Bedrock Wordpress stack on OSX
brew doctor
brew tap caskroom/cask
brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup
brew cask install virtualbox vagrant
brew install rbenv ruby-build
#use bashrc if you are not on zsh
cat >> ~/.zshrc << EOF
# ###
@newloong
newloong / sendgrid.bash
Created April 18, 2018 13:46 — forked from velizarn/sendgrid.bash
Send email from bash script by using SendGrid API
#!/bin/bash
SENDGRID_API_KEY=""
EMAIL_TO=""
FROM_EMAIL=""
FROM_NAME=""
SUBJECT=""
bodyHTML="<p>Email body goes here</p>"
@newloong
newloong / deploy-hooks share-after.yml
Created July 11, 2018 01:45 — forked from mockey/deploy-hooks share-after.yml
Add wp language files on trellis deploy
---
- block:
- name: Install language files
command: wp core language install {{ item }}
args:
chdir: "{{ deploy_helper.new_release_path }}"
# check for existance of po-file, language install should only run once:
creates: "{{ deploy_helper.new_release_path }}/web/app/languages/{{ item }}.po"
with_items: "{{ project.languages }}"
@newloong
newloong / .htaccess
Created July 19, 2018 03:35 — forked from cfxd/.htaccess
Deploy WordPress (Bedrock) with Capistrano to a Shared Host (Bluehost). See http://cfxdesign.com/deploy-wordpress-with-capistrano-on-bluehost/
RewriteEngine on
#change dev.example.com to your domain name
RewriteCond %{HTTP_HOST} ^(www.)?dev.example.com$
RewriteCond %{REQUEST_URI} !^/current/web/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /current/web/$1
#change dev.example.com to your domain name
RewriteCond %{HTTP_HOST} ^(www.)?dev.example.com$
RewriteRule ^(/)?$ current/web/index.php [L]
@newloong
newloong / submenu-descrption.php
Created August 14, 2018 07:25 — forked from atsea/submenu-descrption.php
WordPress: add description to submenu
<?php
/**
* start_lvl and end_lvl
* How can I add parent menu description to my Wordpress menu?
* http://stackoverflow.com/questions/29251897/how-can-i-add-parent-menu-description-to-my-wordpress-menu
*
* start_el
* * How to add menu descriptions to wordpress theme
* http://www.wpbeginner.com/wp-themes/how-to-add-menu-descriptions-in-your-wordpress-themes/
*/
#!/bin/bash
# assign env var, if set
HB="${HOMEBREW_PREFIX:=/usr/local}"
find -L "${HB}/opt" -name 'INSTALL_RECEIPT.json' -maxdepth 2 -print > /tmp/homebrew-installed.txt
printf '' > /tmp/homebrew-installed-w-options.txt
NAME=''