Skip to content

Instantly share code, notes, and snippets.

View binrebin's full-sized avatar
🏠
20 days to release

Bin binrebin

🏠
20 days to release
View GitHub Profile
@binrebin
binrebin / gist:b661e4947b33596f2ddb6f908792948d
Created October 1, 2020 18:03 — 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

@binrebin
binrebin / example.conf
Created December 28, 2019 18:22 — forked from hgn/example.conf
Simple Python aiohttp Server with Configuration Parsing and Logging
server_addr = "127.0.0.1"
server_port = 8888
# debug level, can be debug, error, info, ...
loglevel = "debug"
paths = {
"route_set" : "/",
"interface_get" : "/",
@binrebin
binrebin / docker-config.yml
Created September 5, 2019 11:00 — forked from etsuo/docker-config.yml
docker-config.yml MongoDB replica set
version: "3"
services:
mongo1:
container_name: cf_mongo1
image: mongo:latest
ports:
- "127.0.0.1:37001:27017"
networks:
- backend
command: |
@binrebin
binrebin / postman_install.sh
Created August 25, 2019 09:07 — forked from cagcak/postman_install.sh
Postman install Ubuntu 18.04
#!/bin/bash
# Get postman app
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
sudo ln -s /opt/Postman/Postman /usr/bin/postman
#Create a Desktop Entry
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8