Skip to content

Instantly share code, notes, and snippets.

View tobinbc's full-sized avatar

Tobin tobinbc

View GitHub Profile

Keybase proof

I hereby claim:

  • I am tobinbc on github.
  • I am gbptoken (https://keybase.io/gbptoken) on keybase.
  • I have a public key ASBqidGLcVmOg9nD70jm4YkcsQQcQv_8GZmQrq-Lo1xp6wo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am tobinbc on github.
  • I am tobinc (https://keybase.io/tobinc) on keybase.
  • I have a public key ASCrMchXoJrOTiSivDW_r_8n-W_LwgkCUN8lIVk4Dd_boAo

To claim this, I am signing this object:

#set( $es_items = [] )
#set( $body = $util.parseJson($context.result.body))
#foreach( $entry in $body.hits.hits )
#set ( $item = {
"tree": $entry.get("_source"),
"distance": $entry.get("sort").get(0)
})
$util.qr($es_items.add($item))
#end
#set( $indexPath = "/tree/_doc/_search" )
#set( $input = $ctx.args.input)
#set( $distance = $util.defaultIfNull($input.km, 10) )
#set( $creds = "zx5dej31tt:5inkmy78lz")
{
"version": "2018-05-29",
"method": "POST",
"resourcePath": "$indexPath",
"params": {
"headers" : {
const AWS = require('aws-sdk')
const glue = new AWS.Glue({ apiVersion: '2017-03-31' });
let StorageDescriptor
exports.handler = async ({ Records }) => {
// Get the table data or use cache if this is a subsequent container usage.
if(!StorageDescriptor){
({ Table:{StorageDescriptor} } = await glue.getTable({
DatabaseName: process.env.DATABASE_NAME,
Name: process.env.TABLE_NAME,
}).promise())
this.deeplinks
.route({
'/authevent/loggedin/': {},
})
.subscribe(
match => {
document.location.href = `http://localhost/authevent/loggedin/?code=${match.$args.code}&state=${match.$args.state}`;
},
nomatch => {
console.log('no match', document.URL, nomatch);
initializeApp = async () => {
await this.platform.ready();
const platforms = this.platform.platforms();
switch (true) {
case platforms.includes('cordova'):
this.initMobile();
break;
case platforms.includes('mobileweb'):
case platforms.includes('desktop'):
this.initWeb();
"cordova": {
"plugins": {
...
"ionic-plugin-deeplinks": {
"URL_SCHEME": "awsomeauth",
"DEEPLINK_SCHEME": "https",
"DEEPLINK_HOST": "awsomeauth.co.uk",
"ANDROID_PATH_PREFIX": "/"
}
...
import { Component, OnInit } from '@angular/core';
const env = {
client_id: '1r7gunokp2d5s3no71r4858o3o',
redirect_uri: 'http://localhost:8100/authevent/loggedin',
cognito_custom_domain: 'awesomeauth.auth.eu-west-2.amazoncognito.com'
}
@Component({
selector: 'app-auth-login-button',
import { Component } from '@angular/core';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import { Events, NavController, Platform } from '@ionic/angular';
import { AmplifyService } from 'aws-amplify-angular';
@Component({
selector: 'app-root',
templateUrl: 'app.component.html',