Skip to content

Instantly share code, notes, and snippets.

@markjaquith
markjaquith / disable-plugins-when-doing-local-dev.php
Created June 24, 2011 10:24
Disables specified WordPress plugins when doing local development
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Responsive Design Testing</title>
<style>
body { margin: 20px; font-family: sans-serif; overflow-x: scroll; }
.wrapper { width: 6000px; }
.frame { float: left; }
h2 { margin: 0 0 5px 0; }
@GaryJones
GaryJones / functions.php
Created February 12, 2012 04:01 — forked from billerickson/functions.php
Genesis Grid Loop Advanced
<?php
/**
* Possibly amend the loop.
*
* Specify the conditions under which the grid loop should be used.
*
* @author Bill Erickson
* @author Gary Jones
* @link http://code.garyjones.co.uk/genesis-grid-loop-advanced/
@gmodarelli
gmodarelli / responsive.html
Created February 23, 2012 10:54 — forked from lensco/responsive.html
Simple responsive design test page. More info here: http://bricss.net/post/16538278376/simple-responsive-design-test-page
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Responsive Design Testing</title>
<style>
body { margin: 20px; font-family: sans-serif; overflow-x: scroll; }
.wrapper { width: 6000px; }
.frame { float: left; }
h2 { margin: 0 0 5px 0; }
@media only screen and (min-width: 320px) {
/* Small screen, non-retina */
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px),
@lmarburger
lmarburger / complete.sh
Created October 8, 2012 15:07
TextExpander snippets to create a Markdown image from the CloudApp link on the clipboard. (Simple only works with private links.)
#!/usr/bin/env bash
curl -H 'Accept: application/json' `pbpaste` | sed -e 's/.*"name"//' -e 's/:"\([^"]*\).*"content_url":"\([^"]*\)/![\1](\2)/' -e 's/",.*//'
@HoundstoothSTL
HoundstoothSTL / wp-download.sh
Created November 15, 2012 20:10
Download Wordpress through terminal and cleanup
#!/bin/bash
#Download the latest copy of WordPress into a directory, grab all the files in the new /wordpress folder
#Put all the files in the current directory, remove the now empty /wordpress directory
#Remove the tarball
#download latest wordpress with wget
wget http://wordpress.org/latest.tar.gz
#OR using CURL
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
@bradpotter
bradpotter / enqueue fitvids
Last active December 11, 2015 18:19
Enqueue fitvids from https://github.com/davatron5000/FitVids.js | Props to @realFATmedia & @krogsgard
// Add to functions file
add_action('wp_enqueue_scripts', 'child_javascript_files');
function child_javascript_files() {
wp_register_script( 'fitvids', get_stylesheet_directory_uri() . '/js/jquery.fitvids.js', array('jquery'), '1.0', true );
wp_register_script( 'loadfitvids', get_stylesheet_directory_uri() . '/js/load.fitvids.js', array('fitvids'), '1.0', true );
wp_enqueue_script( 'fitvids' );
wp_enqueue_script( 'loadfitvids' );
}
define( 'CHILD_THEME_VERSION', filemtime( get_stylesheet_directory() . '/style.css' ) );