Skip to content

Instantly share code, notes, and snippets.

View sheabunge's full-sized avatar
😴

Shea Bunge sheabunge

😴
View GitHub Profile
@sheabunge
sheabunge / remove-title-prefix.php
Last active December 20, 2015 00:39 — forked from WerdsWords/protected_title_format.php
Removes the 'Members Only' title prefix from password-protected posts.
<?php
/**
* Removes the 'Members Only' prefix from password-protected posts
*
* @see get_the_title()
*
* @param string $protected Text prefixed to the title for password-protected posts.
*
* @return string The filtered prefix text.
*/
@sheabunge
sheabunge / disable-sitewide-plugins.php
Created July 25, 2013 00:31
When installing Capsule on a WordPress multisite network, the network active plugins can interfere with Capsule and stop it from working. This snippet, when installed as a mu-plugin, will disable all network active plugins for sites that use the Capsule theme.
<?php
/**
* Plugin Name: Disable Sitewide Plugins
* Author: Shea Bunge
* Author URI: http://bungeshea.com
* Version: 0.1
*/
if ( 'capsule' === get_option( 'template' ) ) {
@sheabunge
sheabunge / Fix GitHub URLs on Feedly.user.js
Created August 28, 2013 08:09
When subscribing to your private activity feed on Feedly, the URLs in the feed will be broken and will point to s3.feedly.com instead of github.com. This userscript fixes that.
// ==UserScript==
// @name Fix GitHub URLs on Feedly
// @namespace http://bungeshea.com
// @version 0.1
// @description Fixes links in GitHub feeds from resolving to s3.feedly.com
// @match https?://cloud.feedly.com/#subscription%2Ffeed%2Fhttps%3A%2F%2Fgithub.com%2*.private.atom*
// @copyright Shea Bunge, 2013
// ==/UserScript==
@require "http://code.jquery.com/jquery-latest.min.js";
<?php
/* Register custom post types on the 'init' hook. */
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 0.1.0
* @access public
import sublime, sublime_plugin, os, subprocess
class ConemuCommand(sublime_plugin.TextCommand):
def run(self, edit):
if os.name == "nt":
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
process = subprocess.Popen(('c:/Program Files (x86)/ConEmu/ConEmu.exe', '/single', self.view.file_name()),
@sheabunge
sheabunge / hello-world.ahk
Created January 26, 2014 06:53
"Hello World" in different programming languages
MsgBox Hello World!
@sheabunge
sheabunge / feedly.css
Created February 23, 2014 02:52
Tweaks for Feedly on smaller screens. Use with something like Stylish.
body.home {
top: 0 !important;
margin: 0 auto;
max-width: 100%;
}
#feedlyTabs {
padding-right: 55px !important;
padding-left: 10px !important;
max-width: 200px;
@sheabunge
sheabunge / dl-file.php
Last active August 29, 2015 14:07 — forked from hakre/dl-file.php
<?php
/*
* dl-file.php
*
* Protect uploaded files with login.
*
* @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in
*
* @author hakre <http://hakre.wordpress.com/>
* @license GPL-3.0+
@sheabunge
sheabunge / gist:de7e69eb6d81ad804b26
Last active August 29, 2015 14:15
Not eXactly C line following code
/******************** Line Follow ********************/
task LineFollow()
{
OnFwd(L_MOTOR, POWER);
while(true)
{
if(SENSOR_A_BLACK)
{
if(SENSOR_B_WHITE)
@sheabunge
sheabunge / autoload.php
Last active October 9, 2024 00:31
Basic PHP class autoloader that follows the WordPress coding standards for class names and class filenames
<?php
namespace Shea\Example_Plugin;
/**
* Enable autoloading of plugin classes in namespace.
*
* @param $class_name
*/
function autoload( $class_name ) {