Skip to content

Instantly share code, notes, and snippets.

@mwdiaz
mwdiaz / remove-this.js
Created July 23, 2019 17:40
Codemod to remove `thisArg` from Lodash functions
'use strict';
// Older Lodash functions that used to accept a `thisArg`. In all cases, the
// `thisArg` parameter will be the last.
const methodsThisPos = {
callback: 2,
clone: 4,
cloneDeep: 3,
countBy: 3,
dropRightWhile: 3,
.wufoo input.text,
.wufoo textarea.textarea {
color: #e6e6e6;
background: #0f0f0f;
border-top: 1px solid #212121;
border-right: 1px solid #212121;
border-bottom: 1px solid #212121;
border-left: 1px solid #212121;
padding: 6px 12px 4px;
}
@mwdiaz
mwdiaz / gist:3171503
Created July 24, 2012 17:56 — forked from jonathanmoore/gist:2640302
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