Skip to content

Instantly share code, notes, and snippets.

View jonbish's full-sized avatar

Jon Bishop jonbish

View GitHub Profile
@jonbish
jonbish / block.js
Last active March 12, 2019 19:11
Sample Gutenberg Container Block With Inspector Controls and More
(function (blocks, editor, editPost, i18n, element, components, plugins, _) {
var BlockControls = editor.BlockControls;
var AlignmentToolbar = editor.AlignmentToolbar;
var InspectorControls = editor.InspectorControls;
var InnerBlocks = editor.InnerBlocks;
var PluginBlockSettingsMenuItem = editPost.PluginBlockSettingsMenuItem;
var PluginSidebarMoreMenuItem = editPost.PluginSidebarMoreMenuItem;
var PluginMoreMenuItem = editPost.PluginMoreMenuItem;
var PluginSidebar = editPost.PluginSidebar;
# coding=UTF-8
from __future__ import division
import re
# This is a naive text summarization algorithm
# Created by Shlomi Babluki
# April, 2013
class SummaryTool(object):
@jonbish
jonbish / Filter Inspector
Created May 15, 2012 15:22
Find All Functions Hooking Into A Filter/Action in WordPress
<?php
/*
Plugin Name: Find Functions Hooking Into Filters/Actions
Description: Find All Functions Hooking Into A Filter/Action in WordPress
Author: Jon Bishop
Author URI: http://www.jonbishop.com/
Version: 1.0
*/
function amp_find_filters($filter_name) {
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter