Skip to content

Instantly share code, notes, and snippets.

@Viper007Bond
Viper007Bond / gist:2417309
Created April 18, 2012 23:20
Spotify, Rdio, and Gist embeds for WordPress
<?php
# Spotify
wp_embed_register_handler( 'spotify', '#https?://open\.spotify\.com/.*#', 'spotify_embed_handler' );
add_shortcode( 'spotify', 'spotify_shortcode' );
if ( get_option('embed_autourls') )
add_filter( 'the_content', 'spotify_embed_ids', 7 );
<?php
//Plugin Name: Basic Google Analytics
new Basic_Google_Analytics();
class Basic_Google_Analytics {
function __construct( ) {
add_action( 'admin_init' , array( &$this , 'register_fields' ) );
add_action( 'init' , array( &$this , 'load_after' ) );
}
@jaredatch
jaredatch / global.js
Created June 29, 2012 03:38
Mobile Genesis menus
jQuery(document).ready(function($){
// Mobile navigation
$('#prim-selector, #sec-selector').change(function(){
if ($(this).val()!='') {
window.location.href=$(this).val();
}
});
});
@trepmal
trepmal / gist:3948153
Created October 24, 2012 19:04
wpms nginx conf
server {
listen 80 default;
server_name example.com *.example.com;
# server-side header so I don't have w3c validation errors
add_header X-UA-Compatible "IE=Edge,chrome=1";
# edit locations as desired
access_log /var/www/example.com/logs/access.log;
error_log /var/www/example.com/logs/error.log;