Skip to content

Instantly share code, notes, and snippets.

View lancewillett's full-sized avatar

Lance Willett lancewillett

View GitHub Profile
(?m: <wp:postmeta>
<wp:meta_key>_elasticsearch_indexed_on</wp:meta_key>
<wp:meta_value>.+?</wp:meta_value>
</wp:postmeta>
)
<wp:commentmeta>
<wp:meta_key>_elasticsearch_indexed_on</wp:meta_key>
<wp:meta_value>.+?</wp:meta_value>
</wp:commentmeta>

Keybase proof

I hereby claim:

  • I am lancewillett on github.
  • I am lancewillett (https://keybase.io/lancewillett) on keybase.
  • I have a public key whose fingerprint is BDF4 5533 7D92 6173 9F1B 6EDB E0D7 0F57 9BBE 1E5A

To claim this, I am signing this object:

@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 -->
diff --git a/json-endpoints/class.wpcom-json-api-get-site-endpoint.php b/json-endpoints/class.wpcom-json-api-get-site-endpoint.php
index e6f589f..1a259d3 100644
--- a/json-endpoints/class.wpcom-json-api-get-site-endpoint.php
+++ b/json-endpoints/class.wpcom-json-api-get-site-endpoint.php
@@ -444,19 +444,24 @@ class WPCOM_JSON_API_List_Post_Formats_Endpoint extends WPCOM_JSON_API_Endpoint
$this->load_theme_functions();
}
- // Get a list of supported post formats.
- $all_formats = get_post_format_strings();
<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 -->