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 { driver, structure, process as gremlinProcess } from 'gremlin'; | |
import { fromNodeProviderChain } from '@aws-sdk/credential-providers'; | |
import { getUrlAndHeaders } from 'gremlin-aws-sigv4/lib/utils'; | |
async function getCredentials() { | |
try { | |
const provider = fromNodeProviderChain({ | |
clientConfig: { region: process.env.REGION }, | |
}); | |
const credentials = await provider(); |
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
******************************************************* | |
Neptune Gremlin Profile | |
******************************************************* | |
Query String | |
================== | |
g.withSack(120).V('BOS'). | |
repeat( | |
outE().hasLabel('VOYAGES_TO').sack(sum).by('duration'). | |
sack(sum).by(constant(45)) |
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
<graphml xmlns='http://graphml.graphdrawing.org/xmlns'> | |
<key id='type' for='node' attr.name='type' attr.type='string'></key> | |
<key id='code' for='node' attr.name='code' attr.type='string'></key> | |
<key id='desc' for='node' attr.name='desc' attr.type='string'></key> | |
<key id='author' for='node' attr.name='author' attr.type='string'></key> | |
<key id='date' for='node' attr.name='date' attr.type='string'></key> | |
<key id='labelV' for='node' attr.name='labelV' attr.type='string'></key> | |
<key id='labelE' for='edge' attr.name='labelE' attr.type='string'></key> | |
<key id='mode' for='edge' attr.name='mode' attr.type='string'></key> |
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
g.withSack(120).V( DEPARTURE_PORT ). | |
repeat( | |
(outE().hasLabel('VOYAGES_TO'). | |
sack(sum).by('duration')). | |
sack(sum).by(constant(45) | |
). | |
inV().simplePath() | |
). | |
until( | |
has('code', CANDIDATE_PORT ). |
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
/* | |
Function: TeslaCam-Create-Playlist | |
Runtime: Node.js 10.x | |
Environment: AWS Lambda | |
Description: | |
This function is meant to be triggered by a periodic CloudWatch Event. | |
Upon execution, it will scan an S3 bucket (containing TeslaCam files), | |
build an M3U playlist of processed / merged TeslaCam videos, determine | |
how many *new* videos were added, and push a message to AWS SNS (for alerting). |
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
''' | |
Function: TeslaCam-Merge-Videos | |
Runtime: Python 3.7 | |
Environment: AWS Lambda | |
Description: | |
This function is meant to be invoked by another Lambda (TeslaCam-Identify-Sets-and-Kickoff). | |
Upon execution, it will use the 'event' key of the event dictionary (passed at runtime), and: | |
1. Download camera angle video files from S3 |
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
/* | |
Function: TeslaCam-Identify-Sets-and-Kickoff | |
Runtime: Node.js 10.x | |
Environment: AWS Lambda | |
Description: | |
This function is meant to be triggered by a periodic CloudWatch Event. | |
Upon execution, it will scan an S3 bucket (containing TeslaCam files), | |
identify videos sets which: | |
a) have not been previously processed, and |
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
/** | |
* Copyright (c) 2017 Håvard Fossli. | |
* | |
* Licensed under the MIT license, as follows: | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
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
-----BEGIN PUBLIC KEY----- | |
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwHOsOx1+fxcN0LRPvilU | |
ZGW++ROdt3TtrbbvLKqzQil1lOVaMKguGMnR65rlwsU11DaQ48i9t+J21cEViv/B | |
HGPguUFLbv0/ZZKw+cw1m1OgM8RDDWDIKqKy5bWWxXu8Hi5X2vg30NOZiychvBhm | |
qeIbgzwKblTU9SynA27x/oncNC8sbaql1KmAQ8W26maKjCLrhSyhwU4sQazrsZ85 | |
rBKhzSvz2LjKnYKCRU/3owK1rHK5M73/DUC4gF3NpG3feSeUrQQLSD+vCIoWpF6S | |
4wT35TNJAUiggPeq/nBfZrqlAllRI71SM5YtHJI0+erI5RTN3NDDfV16kM0xdTkk | |
qQIDAQAB | |
-----END PUBLIC KEY----- |
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
extension UIImage { | |
enum Quality { | |
case Best, High, Medium, Low | |
} | |
func toBase64(quality: Quality) -> String { | |
var imageData: NSData |
NewerOlder