Skip to content

Instantly share code, notes, and snippets.

View aquelito's full-sized avatar

Axel Roche aquelito

  • Craftsman developer
  • France
View GitHub Profile
@aquelito
aquelito / other.md
Last active February 9, 2019 22:46
Drupal Snippet

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

// Place your settings in the file "User/Preferences.sublime-settings", which
// overrides the settings in here.
//
// Settings may also be placed in file type specific options files, for
// example, in Packages/Python/Python.sublime-settings for python files.
{
// Sets the colors used within the text area
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
// Note that the font_face and font_size are overridden in the platform
@aquelito
aquelito / article-BlogPosting.html
Created November 6, 2012 22:11
Page Article Schema - BlogPosting
<!DOCTYPE html>
<html lang="fr" itemscope itemtype="http://schema.org/WebPage">
<head>
<meta charset="UTF-8" />
<title>Titre de l'article</title>
<meta itemprop="name" content="Titre de l'article" />
<meta itemprop="description" content="Coutre description de l'article" />
</head>
<body>
<div id="wrapper">
@aquelito
aquelito / editor_plugin.js
Created October 18, 2012 06:52
WordPress Tiny MCE - Change Language Attributes
/*
* plugin/tinymce/editor_plugin.js
*/
(function(){
tinymce.PluginManager.requireLangPack('languages');
tinymce.create('tinymce.plugins.languages', {
createControl: function(n, cm){
/*var list, listlang = {
'en': 'English',
@aquelito
aquelito / output.css
Created April 16, 2012 13:01
SCSS Compass Font Size - Vertical Rhythm
html {
font: 100%/1.5em "Helvetica Neue", Helvetica, Arial, sans-serif; }
body {
background-image: -webkit-gradient(linear, 50% 100%, 50% 0%, color-stop(5%, #e1e1e1), color-stop(5%, rgba(225, 225, 225, 0)));
background-image: -webkit-linear-gradient(bottom, #e1e1e1 5%, rgba(225, 225, 225, 0) 5%);
background-image: -moz-linear-gradient(bottom, #e1e1e1 5%, rgba(225, 225, 225, 0) 5%);
background-image: -o-linear-gradient(bottom, #e1e1e1 5%, rgba(225, 225, 225, 0) 5%);
background-image: linear-gradient(bottom, #e1e1e1 5%, rgba(225, 225, 225, 0) 5%);