Skip to content

Instantly share code, notes, and snippets.

Avatar

Logan Lindquist llbbl

View GitHub Profile
View gist:4b68cc698d5da63711b2

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

@llbbl
llbbl / osx-nginx.conf
Last active Aug 29, 2015
osx-nginx.conf
View osx-nginx.conf
worker_processes 4;
pid /usr/local/etc/nginx/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
@llbbl
llbbl / php.conf
Last active Aug 29, 2015
nginx php.conf
View php.conf
# REQUIREMENTS : Enable PHP Support
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
@llbbl
llbbl / common.conf
Created Nov 11, 2014
common nginx conf for osx
View common.conf
# Global configuration file.
# ESSENTIAL : Configure Nginx Listening Port
listen 80;
# ESSENTIAL : Default file to serve. If the first file isn't found,
index index.php index.html index.htm;
# ESSENTIAL : no favicon logs
location = /favicon.ico {
log_not_found off;
access_log off;
}
@llbbl
llbbl / php.conf
Created Nov 11, 2014
nginx php conf with pid ubuntu
View php.conf
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
@llbbl
llbbl / default
Created Nov 13, 2014
nginx default vhost
View default
server{
server_name default.local;
root /Web/default;
access_log /Web/logs/default.access.log;
error_log /Web/logs/default.error.log;
include /usr/local/etc/nginx/global/common.conf;
include /usr/local/etc/nginx/global/php.conf;
View new_gist_file_0
CREATE DATABASE `mydb` CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON `mydb`.* TO `username`@localhost IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
View .screenrc-main-example
# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills - cwills.sys@gmail.com
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
@llbbl
llbbl / keybase.md
Created Jan 24, 2015
keybase markdown file to verify identity
View keybase.md

Keybase proof

I hereby claim:

  • I am llbbl on github.
  • I am llbbl (https://keybase.io/llbbl) on keybase.
  • I have a public key whose fingerprint is RETU RN T HIS. PGP. GET_ FING ERPR INT( ); }

To claim this, I am signing this object: