Skip to content

Instantly share code, notes, and snippets.

@dhg
dhg / media queries
Created May 15, 2011 19:40
Skeleton Media Queries
/* #Media Queries
================================================== */
/* Smaller than standard 960 (devices and browsers) */
@media only screen and (max-width: 959px) {}
/* Tablet Portrait size to standard 960 (devices and browsers) */
@media only screen and (min-width: 768px) and (max-width: 959px) {}
/* All Mobile Sizes (devices and browser) */
@jdennes
jdennes / LICENSE
Last active March 7, 2024 04:40
Subscribing to a Campaign Monitor list using AJAX
The MIT License (MIT)
Copyright (c) James Dennes
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@jonathonbyrdziak
jonathonbyrdziak / CustomWidgetFile.php
Last active September 29, 2022 22:00
EMPTY WIDGET Plugin code to create a single widget in wordpress.
<?php
/**
* Duplicate this file as many times as you would like, just be sure to change the
* Empty_Widget class name to a custom name of your choice. Have fun! redrokk.com
*
* Plugin Name: Empty Widget
* Description: Single Widget Class handles all of the widget responsibility, all that you need to do is create the html. Just use Find/Replace on the Contact_RedRokk_Widget keyword to rebrand this class for your needs.
* Author: RedRokk Interactive Media
* Version: 1.0.0
* Author URI: http://www.redrokk.com
@billerickson
billerickson / gist:1321001
Created October 27, 2011 21:56
Only show images marked as Include in Rotator
<?php
add_filter( 'be_gallery_metabox_args', 'be_gallery_custom_args' );
/**
* Only show images marked as Include in Rotator
* @author Bill Erickson
* @link http://www.wordpress.org/extend/plugins/gallery-metabox
* @since 1.0
*
* @param array query $args
@jaygooby
jaygooby / strip_related_videos.php
Created November 4, 2011 13:51
Always put a rel=0 attribute on Youtube embedded videos so that related videos aren't shown at the end
@luetkemj
luetkemj / wp-query-ref.php
Last active February 6, 2024 14:25
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
<?php
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link' );
remove_action( 'wp_head', 'index_rel_link' );
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
remove_action( 'wp_head', 'wp_generator' );
@slevithan
slevithan / real-xregexp.js
Created April 4, 2012 14:28
Grammatical pattern for real numbers using XRegExp.build
// Creating a grammatical pattern for real numbers using XRegExp.build
/*
* Approach 1: Make all of the subpatterns reusable
*/
var lib = {
digit: /[0-9]/,
exponentIndicator: /[Ee]/,
digitSeparator: /[_,]/,
@johnbhartley
johnbhartley / kellum-method.css
Created April 19, 2012 04:29
Kellum Method Image Replacement
.hide-text {
height: ;
width: ;
display: block;
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
@crtr0
crtr0 / client.js
Created June 8, 2012 17:02
A simple example of setting-up dynamic "rooms" for socket.io clients to join
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});