This file contains hidden or 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
# Use Warden's on_request hook to track each page view | |
# (every GET request that isn't for an asset) | |
Warden::Manager.on_request do |proxy| | |
if proxy.request.get? && !proxy.request.original_fullpath.start_with?("/assets") | |
payload = { | |
ip: proxy.request.remote_ip, | |
user_agent: proxy.request.user_agent, | |
verb: 'page-view', | |
object: { | |
url: proxy.request.original_url |
This file contains hidden or 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
// 2016 MIT licence. Nick Malcolm. | |
// Based on https://gist.github.com/stevebowman/7cff9dd80b227c899728 | |
// Makes a call using Twilio's API. | |
// Expects the following Lambda environment variables: | |
// TWILIO_ACCOUNT_SID - your account ID | |
// TWILIO_AUTH_TOKEN - an auth token generated in the Twilio console e.g. ABCD1234 | |
// TWILIO_FROM_NUMBER - the number you've purchased to make calls from e.g. +14243700000 | |
// We'll call this number |
This file contains hidden or 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
namespace AppBundle\EventSubscriber; | |
use AppBundle\Entity\User; | |
... | |
use ThisData\Api\ThisData; | |
use ThisData\Api\Endpoint\EventsEndpoint; | |
class SecuritySubscriber implements EventSubscriberInterface | |
{ |
OlderNewer