Skip to content

Instantly share code, notes, and snippets.

View kirillzubovsky's full-sized avatar
💭
High on catnip 🙀

Kirill Zubovsky kirillzubovsky

💭
High on catnip 🙀
View GitHub Profile
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
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

@spraints
spraints / gist:1648617
Created January 20, 2012 17:40
setting up a subscription with stripe

Subscriptions with stripe

Code examples use the stripe ruby gem. Most of the links are to stripe's documentation.

![stripe's object model][stripe_object_model_diagram]

Initial setup

To start, create some plans.

# DEV RELOAD FOR JQUERY / UNDERSCORE
$ = jQuery
# add reloadElement to underscore
_.mixin
# reloads a particular element
reloadElement: (element) ->
if element and element.tagName
tag = element.tagName.toUpperCase()
@jheitzeb
jheitzeb / gist:1104924
Created July 25, 2011 19:15
Google Docs Survey Emailer
function onFormSubmit(e) {
var to_email = "[email protected]";
var ss = SpreadsheetApp.getActiveSpreadsheet();
var spreadsheet_name = ss.getName();
var sheet = ss.getSheets()[0];
var columns = sheet.getRange("A1:U1").getValues()[0];
var email_subject = "New response for [" + spreadsheet_name + "]";
var email_body = "Spreadsheet: " + spreadsheet_name + "\r\n\r\n";
var email_body_html = "<p><b>Spreadsheet: " + spreadsheet_name + "</b></p>";
@intents
intents / intents.html
Created March 30, 2011 14:50
Invoke Intents
<script type="text/javascript">
(function() {
if (window.__twitterIntentHandler) return;
var intentRegex = /twitter\.com(\:\d{2,4})?\/intent\/(\w+)/,
windowOptions = 'scrollbars=yes,resizable=yes,toolbar=no,location=yes',
width = 550,
height = 420,
winHeight = screen.height,
winWidth = screen.width;
@jeffrafter
jeffrafter / server.js
Created August 28, 2010 21:37
Twitter OAuth with node-oauth for node.js+express
var express = require('express');
var sys = require('sys');
var oauth = require('oauth');
var app = express.createServer();
var _twitterConsumerKey = "YOURTWITTERCONSUMERKEY";
var _twitterConsumerSecret = "YOURTWITTERCONSUMERSECRET";
function consumer() {