Skip to content

Instantly share code, notes, and snippets.


Josh Smith joshsmith01

View GitHub Profile
joshsmith01 / Remove all git tags
Created July 12, 2021 19:02 — forked from okunishinishi/Remove all git tags
Delete all git remote tags
View Remove all git tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
joshsmith01 /
Created September 4, 2019 18:00
Find strings that appear on any website.
# ----------- SET COLORS -----------
joshsmith01 / linkheaderparser.js
Created December 15, 2017 18:10 — forked from deiu/linkheaderparser.js
Parse HTTP Link header in Javascript
View linkheaderparser.js
// parse a Link header
// Link:<>; rel=meta
// var r = parseLinkHeader(xhr.getResponseHeader('Link');
// r['meta'] outputs
function parseLinkHeader(header) {
var linkexp = /<[^>]*>\s*(\s*;\s*[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g;
var paramexp = /[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g;
joshsmith01 / validate_gravatar.php
Created December 14, 2017 03:00 — forked from justinph/validate_gravatar.php
In wordpress, a better way to check if an author has a gravatar or not. Sometimes you might want to check to see if a gravatar exists and not display any image if there isn't one. Uses the wordpress HTTP and caching apis. A better version of this:
View validate_gravatar.php
* Utility function to check if a gravatar exists for a given email or id
* @param int|string|object $id_or_email A user ID, email address, or comment object
* @return bool if the gravatar exists or not
function validate_gravatar($id_or_email) {
//id or email code borrowed from wp-includes/pluggable.php
$email = '';
joshsmith01 / nocn.php
Created September 24, 2017 04:43 — forked from bainternet/nocn.php
Function to get terms only if they have posts by post type
View nocn.php
* Function to get terms only if they have posts by post type
* @param $taxonomy (string) taxonomy name eg: 'post_tag','category'(default),'custom taxonomy'
* @param $post_type (string) post type name eg: 'post'(default),'page','custom post type'
* Usage:
* list_terms_by_post_type('post_tag','custom_post_type_name');
View Speaking TODO
# Technical Speaking
## Basics:
### ( ) Introduce yourself
Proportional to the talk
### ( ) Longer full-feature talk === more intro
### ( ) Lighting talks === more succinct intro
- ( ) Name
- ( ) Where you work
- ( ) How long have you been doing this
View wpmdbpro-migration-complete-notifications.php
Plugin Name: WPMDB Pro Migration Complete Notifications
Plugin URI:
Description: Get notified when a migration completes
Author: Delicious Brains
Version: 0.0
Author URI:
joshsmith01 / .gitignore
Last active December 20, 2015 16:47 — forked from salcode/.gitignore
WordPress .gitignore - this is my preferred gitignore file when working with WordPress. It ignores almost all files by default.
View .gitignore
# -----------------------------------------------------------------
# From the root of your project run
# curl -O
# to download this file
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
# To ignore uncommitted changes in a file that is already tracked, use
# git update-index --assume-unchanged