Skip to content

Instantly share code, notes, and snippets.

@RCowles
RCowles / index.html
Created August 6, 2020 16:27
Marxipsm
<html lang="en">
<head>
<title>Marxipsm: Placeholder text for the proletariat</title>
<script src="script.js"></script>
<link rel="stylesheet" href="style.css" />
</head>
<body>
@mixin link-highlight($height) {
border-bottom: none;
text-decoration: none;
box-shadow: inset 0 -4px 0 rgba(0, 170, 220, 0.2);
transition: all 200ms ease-in-out;
&:hover {
box-shadow: inset 0 -$height 0 rgba(0, 170, 220, 0.2);
}
}
@RCowles
RCowles / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
/*
Plugin Name: Disable Publicize Autoselect
Description: Prevent Publicize connections from being auto-selected.
Version: 1.0
Author: Ryan Cowles
Author URI: http://ryanscowles.com/
Plugin URI: http://jetpack.me/2013/10/15/ever-accidentally-publicize-a-post-that-you-didnt/
*/
add_filter( 'publicize_checkbox_default', '__return_false' );
@RCowles
RCowles / custom-functions.php
Created December 23, 2014 00:16
Add Publicize support to Portfolio CPT
function jpme_custom_init() {
add_post_type_support( 'portfolio', 'publicize' );
}
add_action('init', 'jpme_custom_init');
<!-- Map Support Scripts --><div id="ajax_map" class="inline-scripts">
<?php
$settings = return_settings();
$center_single_company = return_single_company();
$item_adrs_sng_lat = return_item_adrs_sng_lat();
$item_adrs_sng_lng = return_item_adrs_sng_lng();
$item_first_cat = return_item_first_cat();
// Get variables metrodir_Options
//Site options
@RCowles
RCowles / custom-functions.php
Last active September 16, 2018 05:43
Move Jetpack's Related Posts
<?php
// Let's unhook the original filter
function jetpackme_remove_rp() {
$jprp = Jetpack_RelatedPosts::init();
$callback = array( $jprp, 'filter_add_target_to_dom' );
remove_filter( 'the_content', $callback, 40 );
}
add_filter( 'wp', 'jetpackme_remove_rp', 20 );
@RCowles
RCowles / gist:d40d23d7ed7a06245912
Created November 6, 2014 22:19
Allow use of shortcodes in text widget
add_filter('widget_text', 'do_shortcode');
@RCowles
RCowles / Custom CSS
Created October 22, 2014 20:36
#1964512-t
.alt-font {
font-family: Arial, sans-serif;
font-style: italic;
}
@RCowles
RCowles / functions.php
Created October 20, 2014 22:54
Customize the output of wp_get_shortlink on your site to replace all shortlinks with standard permalinks.
function tweakjp_cust_shortlink() {
global $post;
if ( !$post )
return;
return get_permalink($post->ID);
}
add_filter( 'get_shortlink', 'tweakjp_cust_shortlink' );