Skip to content

Instantly share code, notes, and snippets.

View Skorch's full-sized avatar

Andrew Beaupre Skorch

View GitHub Profile
func trackSomeEvent(property1: String, property2: String){
SEGAnalytics.shared().track(someEvent, properties: [
"property1": property1,
"property2": property2
])
}
SEGAnalytics.shared().track("myEvent", properties: [
"property1": "value 1",
"property2": "value 2"
])
@Skorch
Skorch / AnalyticsSegmentIOPublisher.swift
Last active December 3, 2016 22:37
A protocol based solution to capturing analytics in Swift 3 v2
//
// AnalyticsSegmentIOPublisher.swift
// DropShift
//
// Created by Drew Beaupre on 2016-10-03.
// Copyright © 2016 drew.beaupre. All rights reserved.
//
import Foundation
import Analytics
@Skorch
Skorch / AnalyticsNotificationManager.swift
Created October 20, 2016 00:12
A protocol based solution to capturing analytics in Swift 3
//
// AnalyticsNotificationSubscriber.swift
// DropShift
//
// Created by Drew Beaupre on 2016-10-03.
// Copyright © 2016 drew.beaupre. All rights reserved.
//
import Foundation
@Skorch
Skorch / s3-upload-processor.js
Last active January 18, 2021 09:13
AWS Lambda function which receives an S3 upload event, fetches the custom headers, parses the encoded payload, and handles the API call
var async = require('async');
var AWS = require('aws-sdk');
AWS.config.update({region:'us-east-1'});
var request = require('request');
var s3 = new AWS.S3({ apiVersion: '2006-03-01' });
var sns = new AWS.SNS();
var new_upload_arn = "arn:aws:sns:us-east-1:346805855669:vuedating_new_presenece";
//Lambda entry point
@Skorch
Skorch / ios-to-s3-background.swift
Last active January 18, 2021 09:13
Uploading from iOS to S3 as a background task. Pro Tip: You can embed REST parameters in the header, and have the server execute a Lambda on upload.
//:
import Foundation
import AWSS3
//A sample struct to define the parameters to encode and send to the
//server to be executed along with your upload
struct FileUploadParameters{
//label for the encoded name
/*
This was a coding challenge in which I had 2 hours to analyze the
requirements (comments at bottom of document) and implement as much
functionality as I could within the time limit.
The code is as-is and not modified in any way once the time limit
had expired.
Andrew Beaupre