Skip to content

Instantly share code, notes, and snippets.

View mizner's full-sized avatar

Michael Mizner mizner

View GitHub Profile
@keeneyemedia
keeneyemedia / bitbucket-pipelines.yml
Created January 10, 2018 21:27
Sample bitbucket-pipelines.yml for WPengine GIT Push
pipelines:
branches:
master:
- step:
script:
- git push git@git.wpengine.com:production/YOUR_INSTALL_NAME.git master
- echo "Completed"
staging:
- step:
script:
@justsml
justsml / fetch-api-examples.md
Last active July 8, 2024 17:26
JavaScript Fetch API Examples
@kevinwhoffman
kevinwhoffman / resources-web-developers-designers.md
Last active January 26, 2024 21:20
Resources for Web Developers and Designers

Resources for Web Developers and Designers

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!

Course Providers

@kingkool68
kingkool68 / svg-functions.php
Created August 4, 2017 03:22
SVG helper functions for WordPress
<?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 = '' ) {
@beardedtim
beardedtim / index.js
Last active July 28, 2017 22:16
Creating mass dummy data in Stripe for testing
/*
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 }) => {
@ahmadawais
ahmadawais / upload-a-file.MD
Created June 18, 2017 11:07 — forked from websupporter/upload-a-file.MD
Upload a file using the WordPress REST API

Upload files

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:

@seize-the-dave
seize-the-dave / configure-macos.sh
Last active July 9, 2020 11:58
Script to install everything onto a new Mac
# 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
@ravibhure
ravibhure / git_rebase.md
Last active June 25, 2024 13:44
Git rebase from remote fork repo

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:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

<?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;
}
@mizner
mizner / docker-wordpress.sh
Created August 16, 2016 10:03 — forked from tatemz/docker-wordpress.sh
A quick way to get a WordPress installation up and running with Docker
#!/bin/bash
mkdir wordpress-site && cd wordpress-site
touch docker-compose.yml
cat > docker-compose.yml <<EOL
my-wpdb:
image: mariadb
ports: