Skip to content

Instantly share code, notes, and snippets.

View elijahzarlin's full-sized avatar

Elijah Zarlin elijahzarlin

View GitHub Profile
@elijahzarlin
elijahzarlin / sheet-mapper-template.html
Created April 3, 2020 17:31
Sheet Mapper Template Code
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Replace with your title</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://api.mapbox.com/mapbox-gl-js/v1.7.0/mapbox-gl.js"></script>
let theinterval = setInterval(function() {
map.setFilter('radarpolygon', ['==', 'idx', currentidx]);
}, 500);
map.addSource('radar-data', {
type: 'vector',
url: 'mapbox://examples.dwtmhwpu'
});
map.addLayer({
"id": "radarpolygon",
"type": "fill",
"source": "raddar-data",
"source-layer": "0",
"filter": ["==", "idx", 0],
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()
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)
]);
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,
@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,
@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-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 / 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",