Skip to content

Instantly share code, notes, and snippets.

View sethrubenstein's full-sized avatar

Seth Rubenstein sethrubenstein

View GitHub Profile
@sethrubenstein
sethrubenstein / mailchimp-103115.html
Created November 2, 2015 20:56
Pew Mailchimp Template
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!--<![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<link rel="stylesheet" type="text/css" href="styles.css">
@sethrubenstein
sethrubenstein / wp-missed-scheduled-check.php
Created August 17, 2015 15:06
WP Missed Schedule CRON
<?php
/**
* Plugin Name: WP Missed Scheduled Check
* Description: Checks for missed scheduled posts once a day and force publishes them if they missed their scheduled publish time.
* Version: 1.0
* Author: Seth Rubenstein
* Author URI: http://sethrubenstein.info
* License: GPL2
*/
@sethrubenstein
sethrubenstein / seths-atom-packages.md
Last active February 16, 2016 23:39
My Current Atom Setup

Seth's Current Atom Packages

Functionality

  1. dockblockr - a helper package for writing documentation.
  2. git-log - graphs your git commits.
  3. git-plus - do git things in Atom without terminal.
  4. grunt-runner - run grun tasks from Atom
  5. language-nginx - adds Nginx syntax/coloring support.
  6. merge-conflicts - Resolve git conflicts visually in Atom.
  7. react (by orktes) - adds React.js JSX langauge support, snippets, auto completion.
@sethrubenstein
sethrubenstein / wp_media_sizes.php
Created August 12, 2015 16:38
WP Media Library Hide Sizes
<?php
/**
* This hook tells the media uploader to only display select sizes to users.
* @param $sizes the original image sizes available to the image editor.
* @return $new_sizes the original $sizes and the new sizes we're adding.
* @author Mahder
*/
function sr_add_image_sizes_to_editor($sizes) {
$new_sizes = array();
@sethrubenstein
sethrubenstein / index.html
Last active August 29, 2015 14:24
Pure CSS browser mockups
<div class="browser-mockup with-url">
<img src="http://placehold.it/500x300/fff/eee" />
</div>
@sethrubenstein
sethrubenstein / playvideosonscroll.js
Last active August 29, 2015 14:21
Play WordPress video shortcodes when in viewport. Requires isInViewport plugin.
jQuery(function() {
jQuery(window).scroll(function() {
jQuery('.wp-video-shortcode').each(function() {
var str = jQuery(this).attr('id');
var arr = str.split('_');
typecheck = arr[0];
if (jQuery(this).is(":in-viewport( 400 )") && typecheck == "mep") {
mejs.players[jQuery(this).attr('id')].media.play();
} else if (typecheck == "mep") {
mejs.players[jQuery(this).attr('id')].media.stop();
location ~* \.(jpe?g|gif|png)$ {
try_files $uri @photon;
}
location @photon {
rewrite ^(.*)-([0-9]+)x([0-9]+)\.(jpe?g|gif|png)$ http://i0.wp.com/$host$1.$4?resize=$2,$3;
rewrite . http://i0.wp.com/$host$request_uri;
}
@sethrubenstein
sethrubenstein / excerpt-length.php
Last active August 29, 2015 14:17 — forked from danielpataki/excerpt-length.php
Some nice WP filters and functions to make posts better.
add_filter( 'excerpt_length', 'my_excerpt_length' );
function my_excerpt_length( $length ) {
return 110;
}
/**
* Override WP oEmbed
* @version 1.0
*/
add_filter( 'embed_oembed_html', 'mycred_override_video_shortcode', 999, 4 );
function mycred_override_video_shortcode( $original, $url, $attr, $post_ID ) {
// If myCRED is not enabled
if ( ! function_exists( 'mycred_render_shortcode_video' ) ) return $original;
// Get cache