Skip to content

Instantly share code, notes, and snippets.

View llbbl's full-sized avatar

Logan Lindquist llbbl

View GitHub Profile

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 August 29, 2015 14:09
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 August 29, 2015 14:09
nginx 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 / php.conf
Created November 11, 2014 22:06
nginx php conf with pid ubuntu
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 / common.conf
Created November 11, 2014 22:54
common nginx conf for osx
# 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 / default
Created November 13, 2014 20:03
nginx default vhost
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;
CREATE DATABASE `mydb` CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON `mydb`.* TO `username`@localhost IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
CREATE DATABASE jiradb CHARACTER SET utf8 COLLATE utf8_bin;
# 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 January 24, 2015 03:12
keybase markdown file to verify identity

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: