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 base64 | |
import json | |
import boto3 | |
snsClient = boto3.client('sns') | |
print('Loading function') | |
def lambda_handler(event, context): | |
for record in event['Records']: | |
# Kinesis data is base64 encoded so decode here |
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
-- ** Anomaly detection ** | |
-- Compute an anomaly score for each record in the source stream using Random Cut Forest | |
-- Creates a temporary stream and defines a schema | |
CREATE OR REPLACE STREAM "TEMP_STREAM" ( | |
"heartRate" INTEGER, | |
"rateType" varchar(20), | |
"ANOMALY_SCORE" DOUBLE); | |
-- Creates an output stream and defines a schema | |
CREATE OR REPLACE STREAM "DESTINATION_SQL_STREAM" ( | |
"heartRate" INTEGER, |
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 json | |
from boto import kinesis | |
import random | |
import time | |
import boto3 | |
cloudwatch = boto3.client('cloudwatch') | |
kinesis = kinesis.connect_to_region("us-east-1") | |
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
{ | |
"Id": "Policy1470255331931", | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "Stmt1470255330209", | |
"Action": [ | |
"s3:DeleteObject" | |
], | |
"Effect": "Deny", |
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
#!/usr/bin/env python | |
from boto.s3.connection import S3Connection | |
from boto.s3.bucket import Bucket | |
ACCESS_KEY_ID = 'YOUR_ACCESS_ID' | |
SECRET_ACCESS_KEY = 'YOUR_SECRET_KEY' | |
# Replace this value with the directory path containing the objects you want to list. | |
# PATH should be in the form of: 'LocalyticsAccountName/YYYY/MM/DD' | |
# Please email support@localytics.com if you do not know your LocalyticsAccountName for S3 access. |
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 boto.s3.connection import S3Connection | |
from boto.s3.bucket import Bucket | |
ACCESS_KEY_ID = 'YOUR_AWS_KEY' | |
SECRET_ACCESS_KEY = 'YOUR_AWS_SECRET' | |
PATH = 'clearchannel/' | |
conn = S3Connection(ACCESS_KEY_ID, SECRET_ACCESS_KEY) | |
bucket = Bucket(conn, 'exports.localytics') |
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
window.onload = start() { | |
startTime = new Date().getTime(); | |
}); | |
window.onbeforeunload = stop() { | |
var endTime = new Date().getTime(); | |
//get duration in milliseconds | |
var duration = endTime - startTime; | |
switch (true) { |
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
#!/usr/bin/env python | |
from boto.s3.connection import S3Connection | |
from boto.s3.bucket import Bucket | |
ACCESS_KEY_ID = 'YOUR_ACCESS_ID' | |
SECRET_ACCESS_KEY = 'YOUR_SECRET_KEY' | |
PATH = 'bridj/2014/10/12' | |
conn = S3Connection(ACCESS_KEY_ID, SECRET_ACCESS_KEY) | |
bucket = Bucket(conn, 'exports.localytics.0-b') |
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
private final static String TAG_SEARCH_USED = "Search Used"; | |
public void searchUsed() | |
{ | |
private final static String PRODUCT_TYPE = "Product Type"; | |
private final static String CATEGORY_ID = "Category ID"; | |
private final static String ORIGINAL_CONTENT_ID = "Original Content ID"; | |
private final static String SEARCH_TERM = "Search Term"; | |
private final static String RESULT_RANKING_SELECTED = "Result Ranking Selected"; | |
private final static String QID = "QID"; |
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 "XYZViewController.h" | |
#import "LocalyticsSession.h" | |
@interface XYZViewController () | |
@end | |
@implementation XYZViewController | |
static NSDate *startOfOverallTime; |