This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.users.find({"AttorneyLeadScore":{$exists:true}}).forEach(function(doc){ | |
if (doc.AttorneyLeadScore && doc.AttorneyLeadScore.length > 0){ | |
var as = doc.AttorneyLeadScore; | |
if (typeof(as[0]) == 'string'){ | |
for (var i = 0; i < as.length; i++){ | |
as[i] = parseInt(as[i]); | |
} | |
print("Updating " + doc._id + ' to ' + as.toString()); | |
//db.users.update({"_id":doc._id},{$set : { 'AttorneyLeadScore' : as}}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, datetime, time | |
class PyMarketo(object): | |
def __init__(self, client_id, client_secret, instance_id): | |
self.client_id = client_id | |
self.client_secret = client_secret | |
self.instance_id = instance_id | |
self.url = "https://{0}.mktorest.com".format(self.instance_id) | |
self.get_token() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As a business user I want my KPI chart to be updated in realtime. Currently our KPI summary look is built using a PDT. | |
The reason is because we want to show the count of different events around the same time dimension. | |
For example if I want to show the number of orders completed and number of orders shipped in the same look. | |
| order_id | ordered_at | shipped_at| | |
1 | 2016-01-01 | 2016-01-02 | |
2 | 2016-01-01 | 2016-01-01 | |
Filter = 2016-01-01 | |
Orders Complete | Orders Shipped |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT cookies | |
FROM user_tracking; | |
"{""ut"": ""53c634eaf8c00000"", ""_ga"": ""GA1.2.940800967.1439230570"", ""_gat"": ""1"", ""kvcd"": ""1445290560648"", ""km_ai"": {""$oid"": ""55c919683dab086217cc148a""}, ""km_lv"": ""x"", ""km_ni"": {""$oid"": ""55c919683dab086217cc148a""}, ""km_uq"": """", ""km_vs"": ""1"", ""__unam"": ""efb39fc-14f1e3fe5c5-562d6fa2-41"", ""optimizelyBuckets"": ""{\""2945870022\"":\""2917090094\"",\""3266580013\"":\""3267360019\"",\""3526560225\"":\""3549300107\""}"", ""optimizelySegments"": ""{\""286422970\"":\""false\"",\""286623248\"":\""gc\"",\""286939202\"":\""referral\"",\""1668900787\"":\""gc\"",\""1675520668\"":\""direct\"",\""1676290438\"":\""false\"",\""2150870732\"":\""gc\"",\""2154301211\"":\""direct\"",\""2170820224\"":\""false\""}"", ""optimizelyEndUserId"": ""oeu1439230569544r0.09696912136860192""}" | |
SELECT cookies->'optimizelyBuckets' | |
FROM user_tracking; | |
"""{\""2945870022\"":\""2917090094\"",\""3266580013\"":\""3267360019\"",\""3526560225\"":\""3549300107\""}""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var timeoutHandle; | |
var i=0; | |
function worker(){ | |
function onDelete(err){ | |
if(err){ | |
console.log(err); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27836 | |
28376 | |
31220 | |
32316 | |
32928 | |
34088 | |
35168 | |
36288 | |
38592 | |
40704 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os.path import expanduser | |
import os | |
import hashlib | |
#Replace the following line with the location of your photo's library. The default location is the home | |
#directory. | |
PATH_TO_PHOTOS_LIBRARY = expanduser("~") + '/Pictures/Photos Library.photoslibrary' | |
hashes = [] | |
for subdir, dirs, files in os.walk(PATH_TO_PHOTOS_LIBRARY + '/Masters'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RestResource(urlMapping='/ConvertLead/') | |
global with sharing class RestLeadConversion { | |
public static Boolean THROW_EXCEPTION = false; | |
public class UnhandledException extends Exception {} | |
public static void generateExceptionForTesting() { | |
if (Test.isRunningTest() && THROW_EXCEPTION) { | |
throw new UnhandledException('Exception for testing'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file a.js | |
------------ | |
var users = {}; | |
var tests = {}; | |
MakeUsesrHttpCall(function(err,res){ | |
users = res; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = require('../../config/config.js'), | |
RedisQueue = require('simple-redis-safe-work-queue'); | |
function processEvent(e, cb) { | |
console.log("Processing Event"); | |
cb(); | |
} | |
var options = { | |
host: config['redisConnection'], |
NewerOlder