Skip to content

Instantly share code, notes, and snippets.

View maxicecilia's full-sized avatar

Maximiliano Cecilia maxicecilia

  • Argentina, Tucuman, San Miguel de Tucuman
View GitHub Profile
@sdebnath
sdebnath / gist:36c235e042cb35db7d1f
Last active July 13, 2018 09:39
Add field to Riak YZ Schema with CRDTs
This gist captures what needs to be done to add a new field to Riak's Yokozuna
search index.
Sources:
- https://github.com/basho/yokozuna/issues/130
- http://riak-users.197444.n3.nabble.com/How-to-update-existed-schema-td4032143.html
The code below is for illustration purposes only. Use at your own risk.
1. Create/Update new schema file
@tsi
tsi / microTplEngine.js
Last active September 29, 2018 07:37
My micro jQuery templating engine
(function($) {
// My micro jQuery templating engine
// Include this script before your closing </body> tag.
// Usage:
//
// <section data-html="content"></section>
//
// This will load <html/content.html> into <section>
@havvg
havvg / ajax-form.js
Created August 1, 2012 13:20
jQuery AJAX form submit with Twitter Bootstrap modal
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
@bobbychopra
bobbychopra / App.xaml.cs
Created June 8, 2012 17:42
Log4Net Configuration in WPF
using System.Windows;
using log4net;
namespace Namespace
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
@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