Skip to content

Instantly share code, notes, and snippets.

View drawcard's full-sized avatar
👍

Drawcard drawcard

👍
  • Drawcard
  • Australia
View GitHub Profile
@anova
anova / .htaccess
Last active March 15, 2023 12:38
Multisite and giving wordpress its own directory
<IfModule mod_rewrite.c>
# not localhost:
# RewriteCond %{HTTP_HOST} \.
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
#eliminate root path access denied: (without placeholder index.php)
RewriteRule ^(/)?$ wp/index.php [L]
# add a trailing slash to /wp-admin
@ahmadawais
ahmadawais / flywheel-local-xdebug-vscode.md
Last active November 23, 2023 16:55
Debug WordPress with Visual Studio Code | VSCode WordPress Debug Setup | WordPress xDebug Setup for Local by FlyWheel with VSCode | Part of the VSCode Learning Course → https://VSCode.pro

VSCode WordPress Debugging Setup: WordPress Xdebug Setup for Local by FlyWheel with VSCode


Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User

🚅 TL;DR

  • Make sure your Local by FlyWheel WordPress install is a custom install
@slushman
slushman / wp_auto_install.sh
Last active December 14, 2018 03:11 — forked from nicomollet/wp_auto_install.sh
WP-CLI auto install local development site script
#!/bin/bash
# Get the required project variables
printf "Project name: "
read PROJECT_NAME
printf "Project folder name: "
read PROJECT_FOLDER
printf "Database Name: "
@pingram3541
pingram3541 / wp-smootstate.js
Created January 22, 2017 20:15
WordPress smoothstate implementation
(function($){
'use strict';
/*
* jQuery htmlDoc "fixer" - v0.2pre - 8/8/2011
* http://benalman.com/projects/jquery-misc-plugins/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
@davemac
davemac / pushstage
Last active November 15, 2017 05:29
wp-cli alias to push a local WP database to a staging site
# wp-cli alias to push a local WP database to a staging site
pushstage() {
START=$(date +%s)
# make a backup of the current local database
# get current directory name, used for database and URL
current=${PWD##*/}
wp db export $current.sql
# rsync the local database to staging site
rsync $current.sql $current-s:~/
# get the staging site URL for search replace
@robinbastien
robinbastien / main.js
Last active January 23, 2018 10:13
CSS Scroll Reveals (Simple WOW.js alternative)
// Get height of window and set an offset from bottom
var winHeight = $(window).height();
var offset = 50;
// Recalc height of window in case of resize
$(window).bind('resizeEnd', function() {
winHeight = $(window).height();
});
// When we scroll we do some checks...
@mizner
mizner / scotchboxphp7.txt
Last active August 23, 2021 10:45
Scotchbox PHP 7
List of PHP 7 Packages: https://launchpad.net/ubuntu/+source/php7.0
Disclaimer: I get unreliable results when I don't run these commands seperately and in order.
vagrant ssh
sudo apt-get update
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install php7.0
sudo apt-get update
@davemac
davemac / pullprod
Last active July 10, 2021 03:42
bash alias using WP-CLI to pull a remote WP database into a local site
# pull a production WP database to an existing local site
# uses current directory as theme path and ssh alias
pullprod() {
START=$(date +%s)
# get current directory name, used for database and URL
# TODO: use echo get_template_directory() and get characters from right to first /
current=${PWD##*/}
cd ~/Sites/$current
# make a backup of the current local database
wp db export _db.sql
@PatelUtkarsh
PatelUtkarsh / backup-sites.sh
Last active February 7, 2017 10:52
Backing up small wp site with DB
#!/bin/bash
# Generate your Dropbox token: https://www.dropbox.com/developers/apps
DROPBOX_TOKEN={dropbox access token here}
# Directory that holds your WordPress sites' root folders
PREFIX=/var/www
# If you have multiple folders with WordPress sites, add/remove them from this array
directories=( "foo.com" "bar.com" )
@ethicka
ethicka / wp-start.sh
Last active December 27, 2023 07:10
WordPress Installation with the Roots/Sage Framework and VirtualHost Creation
#!/bin/bash -e
##
# WordPress Installation and VirtualHost Creation
#
# Description: Installs a WordPress website in the ~/Sites folder, creates a homepage,
# cleans up the WP install a bit, deletes the akismet and hello dolly plugins, creates the permalinks,
# clones the roots/sage theme framework to the theme folder, deletes all the other WP default themes,
# installs/runs npm and bower and runs gulp to create the initial assets, adds a custom gitignore file
# to /wp-content, installs the roots/soil plugin, creates a git repo in wp-content, saves the WordPress