Skip to content

Instantly share code, notes, and snippets.

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

@ziguane
ziguane / gist:62e6632499bca8173f97
Created October 26, 2015 21:31 — forked from zikani03/gist:7c82b34fbbc9a6187e9a
Simple Cors Filter for Spark Java
import java.util.HashMap;
import spark.Filter;
import spark.Request;
import spark.Response;
import spark.Spark;
/**
* Really simple helper for enabling CORS in a spark application;
*/
public final class CorsFilter {
@ziguane
ziguane / Extract Email Addresses
Created January 2, 2016 21:31
A perl script to extract email addresses from a text file. I use this when cleaning up bounced / undeliverable messages from the mailq. The email_to_delete.txt file is a text file that contains text + email addresses. Once the email addresses are extracted to delete_these.txt, I build an SQL query to remove them from the database.
perl -ne'if(/[\w\.\-\_]+@([\w\-\_]+\.)+[A-Za-z]{2,4}/g){print "$&\n"}' email_to_delete.txt | sort | uniq > delete_these.txt
@ziguane
ziguane / manual-uninstall-paragon-ntfs.sh
Created May 21, 2018 20:48 — forked from guycalledseven/manual-uninstall-paragon-ntfs.sh
Manually remove Paragon NTFS v15 leftovers MacOS
# after appcleaner does his magic, do this
sudo rm -rf "/Library/Application Support/Paragon Software/"
sudo rm /Library/LaunchDaemons/com.paragon-software.installer.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfs.loader.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfsd.plist
sudo rm /Library/LaunchAgents/com.paragon-software.ntfs.notification-agent.plist
sudo rm -rf /Library/Filesystems/ufsd_NTFS.fs/
sudo rm -rf /Library/PrivilegedHelperTools/com.paragon-software.installer
sudo rm -rf /Library/Extensions/ufsd_NTFS.kext/
@ziguane
ziguane / unbrick-debrick-tp-link-3020-in-osx.md
Created June 25, 2018 13:13
Unbrick|Debrick TP-LINK 3020 in OS X (includes fun things like breaking warranty)
@ziguane
ziguane / context.ts
Created September 28, 2022 15:47 — forked from thetutlage/context.ts
Unploy Server API Abstraction for AdonisJS
import Up from './index'
declare module '@ioc:Adonis/Core/HttpContext' {
interface HttpContextContract {
up: Up
}
}