Skip to content

Instantly share code, notes, and snippets.

View rmccue's full-sized avatar

Ryan McCue rmccue

View GitHub Profile
@jakedahn
jakedahn / readability.js
Created March 16, 2011 08:28
Readability.js
/*jslint undef: true, nomen: true, eqeqeq: true, plusplus: true, newcap: true, immed: true, browser: true, devel: true, passfail: false */
/*global window: false, readConvertLinksToFootnotes: false, readStyle: false, readSize: false, readMargin: false, Typekit: false, ActiveXObject: false */
var dbg = (typeof console !== 'undefined') ? function(s) {
console.log("Readability: " + s);
} : function() {};
/*
* Readability. An Arc90 Lab Experiment.
* Website: http://lab.arc90.com/experiments/readability
@kvignos
kvignos / 01-01-outbrain-example-recirc.js
Last active May 8, 2017 05:50
WIRED Day of REST 2016 Conference Presentation - Code Snippets
// Author: Ross Patton (abbreviated by KV)
// Link to WIRED json feed
var apiUrl = 'http://' + location.host + '/wp-json/wp/v2/posts/';
// Fallback if OBR not available
if ( typeof OBR === 'undefined' ) {
$( getAll('poweredByOutbrain') ).remove();
return $.getJSON( apiUrl, function(res) {
<?php
//Plugin Name: Debug Edit Freedom
//Description: Edit underscore-prefixed and other protected meta from the admin
if ( defined( 'WP_DEBUG' ) && WP_DEBUG )
add_filter( 'is_protected_meta', '__return_false' );
@pento
pento / hunter2.php
Last active December 28, 2015 06:48
Prevent password leaks in WordPress comments
<?php
function hunter2( $comment_text, $comment ) {
if ( get_current_user_id() !== $comment->user_id ) {
$comment_text = str_replace( 'hunter2', '*******', $comment_text );
}
return $comment_text;
}
add_filter( 'get_comment_text', 'hunter2', 1, 2 );
@jdmaturen
jdmaturen / worker3.py
Created January 25, 2011 03:42
Redis stats aggregator w/ Gevent
import gevent
from gevent import monkey
monkey.patch_socket()
import hashlib
import os
import redis