Skip to content

Instantly share code, notes, and snippets.

View daniran's full-sized avatar

Danny Rudin (Rankevich) daniran

View GitHub Profile
webengage.survey.onSubmit(function(data) {
swLog.debug("Submitted Survey: " + data);
// send data to marketo
try {
var marketoData = {
NPS_Score__c: _.get(_.find(data.questionResponses, { value: { "@class": "score" } }), "value.value"),
NPS_Survey_Date__c: new Date().toISOString(),
NPS_Additional_Details__c: _.get(_.find(data.questionResponses, { value: { "@class": "text" } }), "value.text")
};
[
{
"questionId": "1hrrlb4",
"questionText": "How likely is it that you would recommend SimilarWeb to a friend or colleague?",
"order": 1,
"value": {
"@class": "score",
"value": 8
}
},
[
{
"questionId": "1hrrlb4",
"questionText": "How likely is it that you would recommend SimilarWeb to a friend or colleague?",
"order": 1,
"value": {
"@class": "score",
"value": 7
}
},
@daniran
daniran / .bash_profile
Last active December 14, 2015 12:49
my bash profile
#!/bin/bash
# Prefer US English and use UTF-8
export LC_ALL="en_US.UTF-8"
export LANG="en_US"
# Detect which `ls` flavor is in use
if ls --color > /dev/null 2>&1; then # GNU `ls`
colorflag="--color"
else # OS X `ls`
@daniran
daniran / cart.js
Created July 8, 2012 05:14
Subscription Cart using Backbone
// Load the application once the DOM is ready, using `jQuery.ready`:
$(function(){
// EventBus
var dispatcher = _.clone(Backbone.Events);
//use Mustache.js Template syntax
_.templateSettings = {
interpolate : /\{\{(.+?)\}\}/g
};
@daniran
daniran / dart.txt
Created March 8, 2012 11:02 — forked from paulmillr/dart.md
Leaked internal google dart email
---------- Forwarded message ----------
From: Mark S. Miller <erights@google.com>
Date: Tue, Nov 16, 2010 at 3:44 PM
Subject: "Future of Javascript" doc from our internal "JavaScript Summit"
last week
To: javascript-standard@google.com
On November 10th and 11th, a number of Google teams representing a variety
of viewpoints on client-side languages met to agree on a common vision for
the future of Javascript.