Test
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
# frozen_string_literal: true | |
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do |
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
# frozen_string_literal: true | |
require "pry" | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
# Activate the gem you are reporting the issue against. |
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
# frozen_string_literal: true | |
require "pry" | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
# Activate the gem you are reporting the issue against. |
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
#!/bin/sh | |
brew bundle --file=- <<EOF | |
cask "slack" | |
cask "google-chrome" | |
cask "google-chrome-canary" | |
cask "atom" | |
cask "firefox" | |
cask "mongodb-compass" | |
cask "ngrok" |
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
Capybara.register_driver :chrome do |app| | |
Capybara::Selenium::Driver.new(app, browser: :chrome) | |
end | |
Capybara.register_driver :headless_chrome do |app| | |
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( | |
chromeOptions: { args: %w(headless disable-gpu) } | |
) | |
Capybara::Selenium::Driver.new(app, browser: :chrome, desired_capabilities: capabilities) |
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
{ | |
"name": "sendgrid-webhook-to-mixpanel-lambda", | |
"version": "1.0.0", | |
"description": "A lambda function for tracking SendGrid events in Mixpanel", | |
"main": "index.js", | |
"license": "MIT", | |
"dependencies": { | |
"mixpanel": "^0.7.0", | |
"serverless-http": "^1.5.2" | |
}, |
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
service: sendgrid-webhook-to-mixpanel-lambda | |
provider: | |
name: aws | |
runtime: nodejs6.10 | |
stage: ${opt:stage} | |
region: us-east-1 | |
profile: your-profile | |
environment: | |
MIXPANEL_TOKEN: ${file(./serverless.env.yml):${self:provider.stage}.MIXPANEL_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
const serverless = require('serverless-http'); | |
const Mixpanel = require('mixpanel'); | |
const mixpanel = Mixpanel.init(process.env.MIXPANEL_TOKEN); | |
function handler(event, context, callback) { | |
let body = JSON.parse(event.body); | |
let eventsTracked = 0; | |
body.forEach((sendGridEvent) => { | |
mixpanel.track('SendGrid: ' + sendGridEvent.event, sendGridEvent); |
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
class Api::SendgridEventsController < Api::ApiController | |
def create | |
events = Integrations::SendgridEventsParser.new.track_events(params["_json"]) | |
render json: events.to_json | |
end | |
end | |
class Integrations::SendgridEventsParser | |
def track_events(events) | |
events.each { |e| |
NewerOlder