Skip to content

Instantly share code, notes, and snippets.

Contributing

We're huge fans of open-source, and absolutely we love getting good contributions to segmentio/integrations! These docs will tell you everything you need to know about how to add your own integration to the library with a pull request, so we can merge it in for everyone else to use.

Getting Setup

To start, you need a couple of tools that will help you integrate as fast as possible:

@gjohnson
gjohnson / thing.lang
Last active August 29, 2015 14:14
xslt thing thing
event.properties.* {
key = "${lowercase(.)}"
type = "string"
max = 255
min = 1
}
package lunk
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/json"
"fmt"
"io"
"strconv"
Vagrant.configure(2) do |config|
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
vb.customize ["modifyvm", :id, "--nictype1", "virtio"]
end
end
/*
Fun little experiment with custom attributes
Usage:
<div id="foo" data-foo-bar="awesome" data-whatever="cool"></div>
$('#foo').dataSet() // >> {fooBar: 'awesome', whatever: 'cool'}
or
<div id="foo2"></div>
$('#foo2').dataSet({fooBar: 'awesome', whatever: 'cool'}); // >> <div id="foo" data-foo-bar="awesome" data-whatever="cool"></div>
@gjohnson
gjohnson / basic.ajax.js
Created January 18, 2011 22:30
Basic Ajax Promise
var jxhr = $.ajax('/foo.php', {type:'get', dataType:'json'});
xhr.success(function(response){
// do something with the resposne
});
xhr.error(function(jxhr){
// do something with jxhr
});
console.log('whats up?');
@gjohnson
gjohnson / json.basic.js
Created January 19, 2011 00:38
Basic getJSON example
$.getJSON('foo.php').then(function(r){
console.log(r);
}, function(jxhr){
console.log(jxhr);
});
console.log('whats up?');
@gjohnson
gjohnson / Chained.Ajax.js
Created January 19, 2011 00:39
Promise Chaining
var jxhr = $.ajax('foo.php', {
type: 'get',
dataType: 'json',
success: function (r) {
console.log('1');
jxhr.success(function(r){
console.log('4');
});
}
});
@gjohnson
gjohnson / Deferred.js
Created January 19, 2011 00:40
Deferred Example
var def = new $.Deferred(), data = [1,2,3,4,5];
setTimeout(function(){
def.resolve(data);
}, 5000);
def.then(function(data){
console.log(data);
});
@gjohnson
gjohnson / signature.js
Created January 18, 2011 22:29
jQuery Ajax Signature
$.ajax(url, options);