Skip to content

Instantly share code, notes, and snippets.

Weston Ruter westonruter

Block or report user

Report or block westonruter

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View List_of_languages_by_number_of_native_speakers.html
<table class="wikitable sortable jquery-tablesorter">
<thead>
<tr>
<th class="headerSort headerSortUp" tabindex="0" role="columnheader button" title="Sort descending">Rank</th>
<th class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Language</th>
<th data-sort-type="number" class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Native speakers in millions 2007 (2010)</th>
<th class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Percentage of world population (2007)</th>
</tr>
</thead>
<tbody>
View amp-wp-generator-parsing.py
import re
html = '<html><head><meta name="generator" content="AMP Plugin v1.2.0; mode=standard; experiences=website,stories"></head>...'
pattern = r'<meta name="generator" content="AMP Plugin v(\d+\.\d+[^"]*)"'
matches = re.search( pattern, html )
generator_content = matches.group( 1 )
version = re.sub( r';.*', '', generator_content )
View override-co-authors-plus-amp-meta-author-with-theme-template.php
<?php
add_filter(
'amp_post_template_file',
function ( $file, $type ) {
if ( 'meta-author' === $type ) {
$file = trailingslashit( get_stylesheet_directory() ) . 'amp/meta-author.php';
}
return $file;
},
100,
@westonruter
westonruter / amp-reader-nav-menu.php
Last active Aug 19, 2019
Basic plugin which adds a nav menu to Reader mode templates in the AMP plugin. When in Reader mode, upon activation a new “AMP Reader Sidebar” nav menu location is available for assigning the desired nav menu. Temporary until closed: https://github.com/ampproject/amp-wp/issues/2044
View amp-reader-nav-menu.php
<?php
/**
* Plugin Name: AMP Reader Nav Menu
*
* @package AMP_Reader_Nav_Menu
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
View vidyard-wordpress-plugin.php
<?php
/*
Plugin Name: Vidyard WordPress Plugin
Plugin URI: http://vidyard.com
Description: Makes it easy to embed your Vidyard videos into WordPress.
Version: 1.1.1
Author: Vidyard
Author URI: http://vidyard.com
License: MIT
*/
@westonruter
westonruter / example-follow-links.html
Last active Jul 3, 2019
git clone git@gist.github.com:73412f3e35cdeaade808f3b8da9d9586.git pymjs-testing && wp plugin activate pymjs-testing
View example-follow-links.html
View class-sassy-social-share-public.php.diff
diff --git a/public/class-sassy-social-share-public.php b/public/class-sassy-social-share-public.php
index f22bf00..25ce282 100644
--- a/public/class-sassy-social-share-public.php
+++ b/public/class-sassy-social-share-public.php
@@ -85,17 +85,13 @@ class Sassy_Social_Share_Public {
// stylesheet files for front-end of website
add_action( 'wp_enqueue_scripts', array( $this, 'frontend_css' ) );
- if ( isset( $this->options['amp_enable'] ) ) {
- $amp_options = array();
View amp-suppress-non-admin-validation-error-warnings.php
<?php
/**
* Plugin Name: AMP Suppress Non-Admin Validation Error Warnings
*
* @package AMP_Suppress_Non_Admin_Validation_Error_Warnings
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
View geo-mashup-amp-compat.php
<?php
/**
* Plugin Name: Geo Mashup AMP Compat
*
* @package Geo_Mashup_AMP_Compat
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
You can’t perform that action at this time.