Skip to content

Instantly share code, notes, and snippets.

View elijahzarlin's full-sized avatar

Elijah Zarlin elijahzarlin

View GitHub Profile
<html>
<head>
<title>Deckgl RGB PointCloud + Mapbox</title>
<script src="https://unpkg.com/deck.gl@^7.0.0/dist.min.js"></script>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.54.0/mapbox-gl.js"></script>
<link rel="stylesheet" type="text/css" href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.54.0/mapbox-gl.css">
<style>
body {
background-color: #000000;
margin: 0;
@elijahzarlin
elijahzarlin / pulumixmapbox1.js
Last active June 13, 2019 16:34
pulumixmapbox1
```bash
$ brew install pulumi
$ mkdir asset-tracking && cd asset-tracking
$ pulumi new aws-javascript
$ yarn install
$ ls
Pulumi.dev.yaml Pulumi.yaml index.js node_modules package-lock.json package.json
```
@elijahzarlin
elijahzarlin / pulumixmapbox2.js
Last active June 13, 2019 16:37
pulumixmapbox2.js
```ts
"use strict";
const pulumi = require("@pulumi/pulumi");
const aws = require("@pulumi/aws");
const awsx = require("@pulumi/awsx");
//* Create Kinesis stream for ingestion
const ingestStream = new aws.kinesis.Stream("ingestAssets", {
shardCount: 1,
retentionPeriod: 72
@elijahzarlin
elijahzarlin / pulumixmapbox3.js
Created June 13, 2019 16:38
pulumixmapbox3.js
```ts
//* Create DynamoDB Table
const assetTable = new aws.dynamodb.Table("assetTable", {
attributes: [
{
name: "id",
type: "S"
},
{
name: "ts",
@elijahzarlin
elijahzarlin / upside-down-1.js
Last active July 2, 2019 23:39
upside-down-1
[
"interpolate",
["linear"],
["zoom"],
0,
0,
1,
0,
1.31,
0.01,
@elijahzarlin
elijahzarlin / upside-down-2.js
Last active July 2, 2019 23:38
upside-down-2.js
[
"interpolate",
["linear"],
["zoom"],
0,
["literal", [-42, -40]],
2.01,
["literal", [0, 0]],
3.01,
["literal", [-20, -20]]
@elijahzarlin
elijahzarlin / upside-down-3.js
Created July 2, 2019 23:39
upside-down-3.js
[
"interpolate",
["linear"],
["zoom"],
0,
0,
1.84,
0,
1.85,
1,
LambdaErrorAlarm: {
Type: 'AWS::CloudWatch::Alarm',
Properties: {
AlarmActions: [cf.importValue(cf.sub('on-call-production-${AlarmTeam}'))],
AlarmDescription: 'The Lambda errored more than once in the past 5 minutes.',
AlarmName: cf.join('-', [cf.stackName, cf.region]),
Period: 60,
EvaluationPeriods: 5,
Statistic: 'Sum',
Threshold: 0,
const proj4 = require('proj4');
let pixel_position = [10, 20];
let geo_position = proj4('EPSG:3857', 'EPSG:4326',[
minLng + (maxLng - minLng) * (p[0] / w),
maxLat - (maxLat - minLat) * (p[1] / h)
]);
let current_data = [...];//An h * w array from current step of radar image
let next_data = [...];//An h * w array from next step of radar image
let new_data = [];
for (let i = 0; i < h; i++) {
for (let j = 0; j < w; j++) {
new_data[i * w + j] = parseInt((current_data[i * w + j] + next_data[i * w + j]) / 2);
}
}
let polygons = contours()