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
image: ghcr.io/cirruslabs/flutter:latest | |
stages: | |
- test | |
- deploy | |
unit_tests: | |
stage: test | |
cache: | |
- key: |
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
SELECT names.primary, confidence, categories.main | |
FROM `bigquery-public-data.overture_maps.place` places | |
INNER JOIN ( | |
SELECT geometry FROM `bigquery-public-data.overture_maps.division_area` WHERE names.primary = 'San Francisco' | |
) as city_bounds ON ST_CONTAINS(city_bounds.geometry, places.geometry) | |
ORDER BY confidence DESC |
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
[{"id":1,"name":"Twitch 1","duration":8,"type":"Graphic","render_details":{"path":"/frontend/1/fields/1/contents/1"}},{"id":3,"name":"Standard Embed Final Proof 1","duration":31,"type":"RemoteVideo","render_details":{"path":"https://fast.wistia.net/embed/iframe/j38ihh83m5?autoPlay=true\u0026chromeless=true\u0026playerColor=black\u0026html5=1"}}] |
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
export class DistanceMatrixService extends google.maps.DistanceMatrixService { | |
rateLimiter = new RateLimiter(2, 'second'); | |
static readonly maxElements = 100; | |
async getDistanceMatrixAsync(req: google.maps.DistanceMatrixRequest) { | |
// If the matrix is too big, we have to split up the requests into smaller chunks. | |
if (req.origins!.length * req.destinations!.length > DistanceMatrixService.maxElements) { | |
return this.shardedMatrix(req); | |
} |
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
async function routeBetween( | |
directionSvc: import("./modern_services").DirectionService, | |
parks: Park[] | |
) { | |
const waypoints: google.maps.DirectionsWaypoint[] = parks.map((p) => ({ location: p.place })); | |
const req: google.maps.DirectionsRequest = { | |
origin: 'New York Penn Station', | |
destination: 'New York Penn Station', | |
optimizeWaypoints: true, |
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
export async function filterParks(placesSvc: import("./places").PlacesService): Promise<Park[]> { | |
return Promise.all(ListParks().map((park) => park.findPlace(placesSvc))).then((parks) => { | |
return parks.filter((park) => park.placeResult!.formatted_address!.includes("New York, NY")); | |
}); | |
} | |
export class Park { | |
// Name of the park. | |
name: string; |
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
let placesSvc: import("./places").PlacesService; | |
async function initMap() { | |
const services = await import('./places'); | |
placesSvc = new services.PlacesService(<HTMLDivElement>document.getElementById('attr')); | |
} |
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
import { RateLimiter } from 'limiter'; | |
export class PlacesService extends google.maps.places.PlacesService { | |
rateLimiter = new RateLimiter(2, 'second'); | |
async findPlaceFromQueryAsync(req: google.maps.places.FindPlaceFromQueryRequest) { | |
await this.waitForToken(); | |
return new Promise( | |
( | |
resolve: (result: google.maps.places.PlaceResult[]) => void, |
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
FROM golang:alpine as builder | |
RUN apk update && apk add git && apk add tzdata | |
COPY . $GOPATH/src/github.com/bamnet/village | |
WORKDIR $GOPATH/src/github.com/bamnet/village | |
ARG CGO_ENABLED=0 | |
ARG GOARCH=amd64 | |
ARG GOARM=6 |
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
image: docker:latest | |
services: | |
- docker:dind | |
stages: | |
- build | |
variables: | |
IMAGE: registry.gitlab.com/bamnet/njtdata | |
DOCKER_CLI_EXPERIMENTAL: enabled |
NewerOlder