- http://stackoverflow.com/questions/804115 (
rebase
vsmerge
). - https://www.atlassian.com/git/tutorials/merging-vs-rebasing (
rebase
vsmerge
) - https://www.atlassian.com/git/tutorials/undoing-changes/ (
reset
vscheckout
vsrevert
) - http://stackoverflow.com/questions/2221658 (HEAD^ vs HEAD~) (See
git rev-parse
) - http://stackoverflow.com/questions/292357 (
pull
vsfetch
) - http://stackoverflow.com/questions/39651 (
stash
vsbranch
) - http://stackoverflow.com/questions/8358035 (
reset
vscheckout
vsrevert
)
Using the REST API to upload a file to WordPress is
quite simple. All you need is to send the file in a
POST
-Request to the wp/v2/media
route.
There are two ways of sending a file. The first method simply sends the file in the body of the request. The following PHP script shows the basic principle:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
chmod +x wp-cli.phar | |
sudo mv wp-cli.phar /usr/local/bin/wp | |
siteurl=$(hostname) | |
siteurl="${siteurl%-*}" | |
echo $siteurl | |
echo "${siteurl%-*}" | |
wp core install --url=example.com --title=QuickWP --admin_user=admin --admin_password=123456 --admin_email=info@example.com | |
wp scaffold child-theme twentyseventeen-child --parent_theme=twentyseventeen |
<?php | |
// you'll have to put a plugin header here | |
// Stop auto updated in WordPress 3.7+ | |
add_filter( 'auto_update_core', '__return_false' ); | |
add_filter( 'auto_update_plugin', '__return_false' ); | |
add_filter( 'auto_update_theme', '__return_false' ); | |
add_filter( 'auto_update_translation', '__return_false' ); | |
// stop translation updates when updating plugins or themes |
export HISTCONTROL=ignoredups:erasedups | |
shopt -s histappend | |
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND" |
sub vcl_hit { | |
if (obj.ttl >= 0s) { | |
# normal hit | |
return (deliver); | |
} | |
# We have no fresh fish. Lets look at the stale ones. | |
if (std.healthy(req.backend_hint)) { | |
# Backend is healthy. Limit age to 10s. | |
if (obj.ttl + 10s > 0s) { | |
set req.http.grace = "normal(limited)"; |
#!/bin/bash | |
# Copyright © 2015 Bjørn Johansen | |
# This work is free. You can redistribute it and/or modify it under the | |
# terms of the Do What The Fuck You Want To Public License, Version 2, | |
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. | |
WP_PATH="/path/to/wp" | |
# Check if WP-CLI is available | |
if ! hash wp 2>/dev/null; then |
This is a git pre-push hook intended to help developers keep their PHP code base clean by performing a scan with PHP CodeSniffer whenever new code is pushed to the repository. When any coding standards violations are present the push is rejected, allowing the developer to fix the code before making it public.
To increase performance only the changed files are checked when new code is
This tutorial walks through setting up AWS infrastructure for WordPress, starting at creating an AWS account. We'll manually provision a single EC2 instance (i.e an AWS virtual machine) to run WordPress using Nginx, PHP-FPM, and MySQL.
This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. It is intended for folks who want a high-level of control and understanding of their infrastructure. It will take about half an hour if you don't Google away at some point.
If you experience any difficulties or have any feedback, leave a comment. 🐬
Coming soon: I'll write another tutorial on a high availability setup for WordPress on AWS, including load-balancing multiple application servers in an auto-scaling group and utilizing RDS.