This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipelines: | |
branches: | |
master: | |
- step: | |
script: | |
- git push [email protected]:production/YOUR_INSTALL_NAME.git master | |
- echo "Completed" | |
staging: | |
- step: | |
script: |
This is an incomplete list of resources including courses and individuals who publish content that has helped me grow as a web developer and designer. Many of these resources are WordPress-specific as that is my current area of specialization. This list will grow over time. If you've got something to add, send me a link @kevinwhoffman and I'll check it out!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Throw this in your theme and include it in your functions.php file | |
/** | |
* Helper function for fetching SVG icons | |
* | |
* @param string $icon Name of the SVG file in the icons directory | |
* @return string Inline SVG markup | |
*/ | |
function wp_svg_icon( $icon = '' ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
We get the dummy tokens from | |
https://stripe.com/docs/testing#cards-responses | |
*/ | |
const stripe = require('stripe')(process.env.STRIPE_KEY); | |
const faker = require('faker'); | |
const createAmount = () => Math.floor(Math.random() * 2000) + 500 | |
const makeCharge = ({ source }) => { |
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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install command line developer tools | |
xcode-select --install | |
# Install Brew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Reset brew | |
brew update | |
brew upgrade brew-cask | |
brew cleanup |
In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:
git remote add upstream https://github.com/whoever/whatever.git
git fetch upstream
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
spl_autoload_register(function ($class) { | |
//change this to your root namespace | |
$prefix = 'vendor\\rootnamespace\\'; | |
//make sure this is the directory with your classes | |
$base_dir = __DIR__ . '/classes/'; | |
$len = strlen($prefix); | |
if (strncmp($prefix, $class, $len) !== 0) { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir wordpress-site && cd wordpress-site | |
touch docker-compose.yml | |
cat > docker-compose.yml <<EOL | |
my-wpdb: | |
image: mariadb | |
ports: |
NewerOlder