Skip to content

Instantly share code, notes, and snippets.

View lancewillett's full-sized avatar

Lance Willett lancewillett

View GitHub Profile
@lancewillett
lancewillett / shorten-bookmarklet.js
Created October 21, 2010 06:53 — forked from simonw/shorten-bookmarklet.js
Add support for shortlink
/* Expanded form of a bookmarklet for extracting rev=canonical OR tinyurling a page */
(function(){
var url=document.location;
var links=document.getElementsByTagName('link');
var found=0;
for(var i = 0, l; l = links[i]; i++) {
if (l.getAttribute('rev') == 'canonical' || (/alternate short/).exec(l.getAttribute('rel'))) {
found=l.getAttribute('href');
break;
}
Index: /p2/style.css
===================================================================
--- /p2/style.css (revision 10382)
+++ /p2/style.css (revision 10384)
@@ -985,7 +985,10 @@
.inlineediting .tags {
float: left;
+ position: relative;
+ z-index: 2;
}
/**
* navigation.js
*
* Handles toggling the navigation menu for small screens.
*/
( function() {
var button = document.getElementById( 'site-navigation' ).getElementsByTagName( 'h3' )[0],
menu = document.getElementById( 'site-navigation' ).getElementsByTagName( 'ul' )[0];
button.onclick = function() {
/**
* Loads our special font CSS file.
*
* To override in a childe theme, simply unhook the 'twentytwelve_custom_font_style' action.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_custom_font_style() {
$protocol = is_ssl() ? 'https' : 'http';
wp_enqueue_style( 'twentytwelve-fonts', "$protocol://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700", array(), null );
@lancewillett
lancewillett / gist:3762698
Created September 21, 2012 17:10
List markup example
<ul>
<li>Top List 1</li>
<li>Top List 2, with children
<ul>
<li>Second level, child of Top List 2</li>
<li>And another list item</li>
<li>And a third list item, with children
<ul>
<li>I'm a third-level list item</li>
</ul><!-- Closing third level child list -->
<div class="entry-content">
<p>This video is so cool.</p>
<p><iframe width="584" height="329" src="http://www.youtube.com/embed/pAE7mqHWkyg?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
<div class="post-format-content"><a href="http://www.youtube.com/watch?v=MBfjeFr67Ls">www.youtube.com/watch?v=MBfjeFr67Ls</a></div>
</div><!-- .entry-content -->
function twentythirteen_compat_customizer() {
if ( version_compare( $GLOBALS['wp_version'], '3.6-alpha', '>=' ) )
return;
wp_redirect( '/wp-admin/themes.php' );
}
add_action( 'load-customize.php', 'twentythirteen_compat_customizer' );
<video class="wp-video-shortcode" id="video-975-1" width="724" height="360" controls="controls" preload="none"><source type="video/m4v" src="http://wordpress-trunk:8888/wp-content/uploads/2013/03/merge-1.m4v" /><source type="" src="http://wordpress-trunk:8888/?attachment_id=976" /><a href="http://wordpress-trunk:8888/wp-content/uploads/2013/03/merge-1.m4v">http://wordpress-trunk:8888/wp-content/uploads/2013/03/merge-1.m4v</a></video> </div>
<a href="http://wordpress-trunk:8888/about/clearing-floats/olympus-digital-camera/"><img src="http://wordpress-trunk:8888/wp-content/uploads/2012/07/manhattansummer.jpg" width="640" height="480" alt="OLYMPUS DIGITAL CAMERA" class="wp-image-827 alignnone size-large" /></a>
/*
Theme Name: Your Theme Name
Theme URI: Your Theme URL
Author: Your Name
Author URI: Your URL
Description: Describe your theme and its features.
Version: Your Theme's Version Number
License: GNU General Public License
License URI: license.txt
Tags: insert tags to describe your theme to help users search for it. Find the list of tags at: http://wordpress.org/extend/themes/about/