Skip to content

Instantly share code, notes, and snippets.

View joshsmith01's full-sized avatar

Josh Smith joshsmith01

View GitHub Profile
@joshsmith01
joshsmith01 / Remove all git tags
Created July 12, 2021 19:02 — forked from okunishinishi/Remove all git tags
Delete all git remote 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
joshsmith01 / findstring.sh
Created September 4, 2019 18:00
Find strings that appear on any website.
#!/bin/bash
# ----------- SET COLORS -----------
COLOR_RED=$'\e[31m'
COLOR_CYAN=$'\e[36m'
COLOR_YELLOW=$'\e[33m'
COLOR_GREEN=$'\e[32m'
COLOR_RESET=$'\e[0m'
COLOR_HIGHLIGHT_FOUND=$'\e[0;30;42m'
#DOMAIN=https://www.efficiencyofmovement.com
@joshsmith01
joshsmith01 / linkheaderparser.js
Created December 15, 2017 18:10 — forked from deiu/linkheaderparser.js
Parse HTTP Link header in Javascript
// parse a Link header
//
// Link:<https://example.org/.meta>; rel=meta
//
// var r = parseLinkHeader(xhr.getResponseHeader('Link');
// r['meta'] outputs https://example.org/.meta
//
function parseLinkHeader(header) {
var linkexp = /<[^>]*>\s*(\s*;\s*[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g;
var paramexp = /[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g;
@joshsmith01
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: http://codex.wordpress.org/Using_Gravatars#Checking_for_the_Existence_of_a_Gravatar
/**
* 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
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
<?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');
# 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
<?php
/*
Plugin Name: WPMDB Pro Migration Complete Notifications
Plugin URI: http://deliciousbrains.com
Description: Get notified when a migration completes
Author: Delicious Brains
Version: 0.0
Author URI: http://deliciousbrains.com
*/
@joshsmith01
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.
# -----------------------------------------------------------------
# From the root of your project run
# curl -O https://gist.githubusercontent.com/joshsmith01/8e20edbf910d909415b6/raw/.gitignore
# 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