Skip to content

Instantly share code, notes, and snippets.

Avatar

Jake Bellacera jakebellacera

View GitHub Profile
@jakebellacera
jakebellacera / _Integrate-Yoast-and-CoAuthors-Plus-in-WordPress.md
Last active Feb 2, 2018
Integrate Yoast and CoAuthors Plus in WordPress
View _Integrate-Yoast-and-CoAuthors-Plus-in-WordPress.md

Integrate Yoast and Co-Authors Plus

If your WordPress site utilizes both Co-Authors Plus and Yoast, you may be aware that the two plugins don't fully integrate with eachother. The PHP code below fixes the following issues:

  • When viewing a Co-Author's page, Yoast's author name (%%name%%) meta tag template variables will properly show the Co-Author's name.
  • When viewing a Co-Author's page, Yoast's breadcrumb trail will properly show the Co-Author's name.

How to install

Simply drop the code below into your theme's functions.php file.

@jakebellacera
jakebellacera / robots.txt
Created Sep 14, 2017
Robots.txt file instructing crawlers to not crawl any pages on the hostname
View robots.txt
User-agent: *
Disallow: /
@jakebellacera
jakebellacera / .htaccess-wordpress
Created Aug 7, 2017
Default htaccess configuration for a WordPress site
View .htaccess-wordpress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
@jakebellacera
jakebellacera / pantheon-lando-without-proxy.md
Last active Jul 18, 2017
How to set up a pantheon lando application without the proxy on macOS 10.12+
View pantheon-lando-without-proxy.md

How to set up a pantheon lando application without a proxy on macOS 10.12+

This guide explains how to use a pantheon lando application without the proxy server on your local machine. Instead of using a proxy server, you will use dnsmasq and pfctl to port forward your lando application's webserver ports to 80 and 443.

Note: you will have to perform some manual interactions for each lando application you create. See the instructions below.

  1. First, install homebrew

  2. Then, install and setup dnsmasq with homebrew:

@jakebellacera
jakebellacera / multi-line-lists-in-markdown.md
Last active Aug 27, 2018
How to write multi-line lists in Markdown
View multi-line-lists-in-markdown.md

Perhaps you're writing an ordered list in markdown and you need to add a list item or two with multiple lines. You try to write it, but your numbers keep resetting! What gives?

What you need to do is add a space after each additional line in a list item.

Quick example

1. Item number one

 Second line in item number one.
@jakebellacera
jakebellacera / how-to-get-youtube-video-id.md
Last active Jul 2, 2020
Learn how to get the ID of any YouTube video.
View how-to-get-youtube-video-id.md

How to get the ID of any YouTube Video

This article walks you through how to get the ID of any YouTube video.

How to get a YouTube video ID from a youtube.com page URL

You may be watching the video or just happened to visit a link to a video. The video ID will be located in the URL of the video page, right after the v= URL parameter.

@jakebellacera
jakebellacera / how-to-install-php-development-environment-on-osx.md
Last active Aug 24, 2018
How to install a basic Apache, PHP and MySQL development environment with Homebrew. Mirrored from the Echo & Co. blog.
View how-to-install-php-development-environment-on-osx.md

How to install a basic Apache, PHP and MySQL development environment with Homebrew

This guide will walk you through the steps required to install a basic Apache, PHP and MySQL development environment using homebrew. Basically, all you'll need to do is copy the commands below into Terminal. Copy one block at a time.

NOTE: this guide is mirrored from Echo & Co.'s blog in case the original blog post or the website decides to go down. I've shared this guide around many times to colleagues and friends. Please give Alan Ivey (@alanthing) all of the credit for publishing this really helpful guide.

Before we begin...

We're going to need to install homebrew, a super awesome package manager for OS X. Installation instructions are available on the homebrew website.

@jakebellacera
jakebellacera / basic-meta-tags.html
Created Aug 17, 2016
Basic example of SEO-friendly HTML meta tags.
View basic-meta-tags.html
<!DOCTYPE html>
<html>
<head>
<title>My Page's Title - Site Name</title>
<meta name="description" content="My page's description. This should be no more than 155 characters or else it may be truncated.">
<meta name="og:title" content="My Page's title">
<meta name="og:description" content="My page's description. This should be no more than 155 characters or else it may be truncated.">
<meta name="og:image" content="http://mywebsite.com/default-og-thumbnail.png">
</head>
<body>
@jakebellacera
jakebellacera / force_new_tab.php
Last active Jun 3, 2016
Force PDF links to open in a new tab in PHP.
View force_new_tab.php
$new_text = preg_replace(
'/((<a (?=.*\.pdf)(?!.*target="_blank").*?)>)/',
'$2 target="_blank">',
$old_text
);
@jakebellacera
jakebellacera / multiple-gulp-streams.js
Created May 1, 2015
How to run multiple streams in a single gulp task.
View multiple-gulp-streams.js
var es = require("event-stream");
var gulp = require("gulp");
// Important! If these tasks need to be ran sequentially, then specify the
// task(s) that need to be ran prior to these ones as a dependency.
gulp.task("move-files", function() {
return es.merge([
gulp.src("foo").pipe(gulp.dest("dist/")),
gulp.src("bar").pipe(gulp.dest("dist/")),
gulp.src("baz").pipe(gulp.dest("dist/")),
You can’t perform that action at this time.