Skip to content

Instantly share code, notes, and snippets.

@mikemanger
mikemanger / YTD Strava Metrics
Last active Dec 2, 2021
YTD Strava Metrics
View YTD Strava Metrics
Running 276.82 km █▉░░░░░░░░░░░░░░░░░ 11.17/h
Cycling 2369.87 km █████████████████░░ 25.73/h
@mikemanger
mikemanger / th_shipping_options.php
Last active Mar 12, 2018 — forked from VjWoo/th_shipping_options.php
Shipping Options plugin
View th_shipping_options.php
<?php
/*
Plugin Name: TH Shipping Options
Plugin URI: NA
Description: TH Shipping Options plugin
Version: 1.0.0
Author: Vj
Author URI: www.wooforce.com
*/
@mikemanger
mikemanger / humble-bundle-key-cache.user.js
Last active Jan 20, 2018
Caches your Humble bundle key list
View humble-bundle-key-cache.user.js
// ==UserScript==
// @name Humble Bundle key cache
// @include https://www.humblebundle.com/home*
// @updateURL https://gist.githubusercontent.com/mikemanger/b5bb71c9b9a1ac70b7ad/raw
// @downloadURL https://gist.githubusercontent.com/mikemanger/b5bb71c9b9a1ac70b7ad/raw
// @grant GM_setValue
// @grant GM_getValue
// @run-at document-end
// @version 1.1.4
// ==/UserScript==
@mikemanger
mikemanger / desura-game-labeler.user.js
Last active Dec 6, 2016
Displays titles on your Desura collection page
View desura-game-labeler.user.js
// ==UserScript==
// @name Desura Game Labeler
// @include http://www.desura.com/collection
// @updateURL https://gist.githubusercontent.com/ohmanger/b057f444cd2d5205bdfc/raw
// @downloadURL https://gist.githubusercontent.com/ohmanger/b057f444cd2d5205bdfc/raw
// @require https://gist.githubusercontent.com/BrockA/2625891/raw
// @grant none
// @version 1.2.2
// ==/UserScript==
@mikemanger
mikemanger / indieroyalebundlehider.user.js
Last active Dec 6, 2016
Hides bundles you don't own from your Indie Royale collection page
View indieroyalebundlehider.user.js
// ==UserScript==
// @name Indie Royale Bundle Hider
// @description Hides bundles you don't own from your collection page
// @include http://www.indieroyale.com/collection
// @updateURL https://gist.githubusercontent.com/ohmanger/71334947a6f7470ef16e/raw
// @downloadURL https://gist.githubusercontent.com/ohmanger/71334947a6f7470ef16e/raw
// @grant none
// @version 1.1.1
// ==/UserScript==
@mikemanger
mikemanger / indieroyale.user.js
Last active Dec 6, 2016
Indie Royal Collection Labeler
View indieroyale.user.js
// ==UserScript==
// @name Indie Royale Bundle Labeler
// @include http://www.indieroyale.com/collection
// @updateURL https://gist.githubusercontent.com/ohmanger/ca837343473033b1d9bb/raw
// @downloadURL https://gist.githubusercontent.com/ohmanger/ca837343473033b1d9bb/raw
// @grant none
// @version 1.3.1
// ==/UserScript==
function irbl_add_global_styles() {
@mikemanger
mikemanger / reposition-gform-blog-templates.php
Last active Aug 29, 2015
(WordPress) Reposition New Blog Templates
View reposition-gform-blog-templates.php
<?php
/*
Plugin Name: Reposition New Blog Templates
Description: Move New Blog Template selection to a different Gravity Form page.
Author: Mike Manger
Author URI:
*/
function mm_rnbt_get_form_filter( $form_html, $form ) {
// Let's check if the option for New Blog Templates is activated in this form
@mikemanger
mikemanger / .maintenance
Last active Sep 14, 2021
Example WordPress .maintenance file. maintenance.php is optional but useful for styling the message the public will see (it is also used when updating WordPress conponments), drop it in your wp-content folder.
View .maintenance
<?php
function is_user_logged_in() {
$loggedin = false;
foreach ( (array) $_COOKIE as $cookie => $value ) {
if ( stristr( $cookie, 'wordpress_logged_in_' ) ) {
$loggedin = true;
}
}
return $loggedin;
}
@mikemanger
mikemanger / typekit.editor.php
Last active Mar 8, 2020 — forked from tomjn/typekit.editor.php
Add a TypeKit font to the TinyMCE editor in WordPress.
View typekit.editor.php
add_filter( 'mce_external_plugins', 'my_theme_mce_external_plugins' );
function my_theme_mce_external_plugins( $plugin_array ) {
$plugin_array['typekit'] = get_template_directory_uri() . '/typekit.tinymce.js';
return $plugin_array;
}
@mikemanger
mikemanger / functions.php
Created Mar 19, 2014
Sessions in WordPress themes & plugins.
View functions.php
/**
* Setup last page context.
*/
session_start();
function my_theme_php_shutdown() {
$_SESSION['my_theme_from_search'] = is_search();
}
add_action( 'shutdown', 'my_theme_php_shutdown' );
/**