Skip to content

Instantly share code, notes, and snippets.

View dylanjameswagner's full-sized avatar

Dylan James Wagner dylanjameswagner

View GitHub Profile
@ebetancourt
ebetancourt / wp-disable-plugin-update.php
Last active April 16, 2026 13:58 — forked from rniswonger/wp-disable-plugin-update.php
WordPress - Disable specific plugin update check
<?php
// have to add that opening tag to get syntax highlighting... ¯\_(ツ)_/¯
/**
* Prevent update notification for plugin
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* Place in theme functions.php or at bottom of wp-config.php
*/
function disable_plugin_updates( $value ) {
@jordanmaslyn
jordanmaslyn / redirects-admin.php
Created January 8, 2016 17:16
Redirection CSV Plugin
<?php
// include this in your theme's functions.php file
// Find & Replace all instances of 'prefix' and replace with the brand name.
// the file itself expects to be in /wp-content/themes/prefix/functions/modules/
add_action( 'admin_menu', 'prefix_redirects_admin_menu' );
function prefix_redirects_admin_menu() {
add_menu_page(
@jordanmaslyn
jordanmaslyn / .htaccess
Created December 23, 2015 22:17
Drop this in an .htaccess in your Wordpress uploads folder. It will check for the upload on your existing site, and if it doesn't find it there, will look for it on your live site.
# /wp-content/uploads/.htaccess
# Attempt to load files from production if they're not in our local version
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) http://www.LIVESITEURL.TLD/wp-content/uploads/$1
</IfModule>
# Shell prompt based on the Solarized Dark theme.
# Screenshot: http://i.imgur.com/EkEtphC.png
# Heavily inspired by @necolas’s prompt: https://github.com/necolas/dotfiles
# iTerm → Profiles → Text → use 13pt Monaco with 1.1 vertical spacing.
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM='gnome-256color';
elif infocmp xterm-256color >/dev/null 2>&1; then
export TERM='xterm-256color';
fi;
@bjmiller121
bjmiller121 / multiple-push-urls.md
Last active September 29, 2025 04:07
Add multiple push URLs to a single git remote

Sometimes you need to keep two upstreams in sync with eachother. For example, you might need to both push to your testing environment and your GitHub repo at the same time. In order to do this simultaneously in one git command, here's a little trick to add multiple push URLs to a single remote.

Once you have a remote set up for one of your upstreams, run these commands with:

git remote set-url --add --push [remote] [original repo URL]
git remote set-url --add --push [remote] [second repo URL]

Once set up, git remote -v should show two (push) URLs and one (fetch) URL. Something like this:

@rogeruiz
rogeruiz / animationEngine.js
Last active August 29, 2015 14:19
Animation Engine used on How We Work for CISofRichmond
import { $, RSVP, _, Snap, mina, help } from 'util';
var Fn = function() {
var fn = this;
this.DELAY_START = 250;
this.ANIMATION_DURATION = 550;
this.CIRCLE_ROTATION_DURATION = 50000;
this.el = {
@eduardozulian
eduardozulian / wp-taxonomy-dropdown.php
Last active May 5, 2024 14:45
Callback function for 'meta_box_cb' argument inside register_taxonomy() that replaces the regular checkboxes with a plain dropdown list
<?php
/**
* Callback function for taxonomy meta boxes
*
* A simple callback function for 'meta_box_cb' argument
* inside register_taxonomy() that replaces the regular
* checkboxes with a plain dropdown list
*
* @param [type] $post [description]
* @param [type] $box [description]
@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active March 29, 2026 12:20
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@umidjons
umidjons / dirname_basename.js
Last active August 26, 2018 17:28
PHP dirname() and basename() alternatives for JavaScript
function basename( path )
{
return path.replace( /\\/g, '/' ).replace( /.*\//, '' );
}
function dirname( path )
{
return path.replace( /\\/g, '/' ).replace( /\/[^\/]*$/, '' );
}
console.log( dirname( '/srv/www/dev/umid/admin/cfg.admin.php' ) );