Skip to content

Instantly share code, notes, and snippets.

View sheabunge's full-sized avatar
😴

Shea Bunge sheabunge

😴
View GitHub Profile
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()),
<?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
@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";
@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 / 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 / explainxkcd.js
Created July 19, 2013 23:08
Explain xkcd bookmarklet
javascript:location.href='http://www.explainxkcd.com/wiki/index.php?title='+window.location.pathname.replace(/^\/|\/$/g, '')
@sheabunge
sheabunge / jquery.scrolling-anchors.js
Created July 18, 2013 06:30
Make anchors smoothly scroll down the page when clicked on, instead of jumping.
$(function(){
$('a[href^="\\#"]').click(function(event){
event.preventDefault();
var full_url = this.href;
var parts = full_url.split("#");
var trgt = parts[1];
var target_offset = $("#"+trgt).offset();
var target_top = target_offset.top;
$('html, body').animate({scrollTop:target_top}, 500);
});
@sheabunge
sheabunge / oembed-in-comments.php
Created July 17, 2013 08:18
Allows the use of oEmbed in WordPress comments
<?php
/**
* Plugin Name: oEmbed in Comments
* Description: Allow oEmbeds in comment text. A fork of http://wordpress.org/plugins/oembed-in-comments/
* Version: 1.2
* Author: Evan Solomon, modified by Shea Bunge
*/
class oEmbed_Comments {
<?php
/**
* Plugin Name: oEmbed in Comments
* Description: Allow oEmbeds in comment text. A fork of http://wordpress.org/plugins/oembed-in-comments/
* Version: 1.2
* Author: Evan Solomon, modified by Shea Bunge
*/
class oEmbed_Comments {
@sheabunge
sheabunge / redirect-single-post.php
Created June 3, 2013 00:15
If the search query only returns a single post, redirect to that post.
<?php
/**
* If the search query only returns a single post, redirect to that post.
*
* @return void
* @author Paulund
* @link http://www.paulund.co.uk/redirect-search-results-return-one-post
*/
function redirect_single_post() {