Skip to content

Instantly share code, notes, and snippets.

@sfabijanski
sfabijanski / filterArray.js
Created June 1, 2021 18:16 — forked from jherax/filterArray.js
Filters an array of objects with multiple match-criteria.
/**
* Filters an array of objects using custom predicates.
*
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria
* @return {Array}
*/
function filterArray(array, filters) {
const filterKeys = Object.keys(filters);
return array.filter(item => {
@sfabijanski
sfabijanski / README.md
Last active April 5, 2023 17:37
ADO Build Pipeline Template

ADO Build Pipeline Template

A template build pipeline that demonstrates a few possible choices when building a pipeline

  • naming the build with the name keyword
  • triggering on various branches
  • triggering only when the files updated are in a particular folder
  • dynamic variable assignment based off of the branch committed to
  • could also be handled with variable groups (not used here)
@sfabijanski
sfabijanski / README.md
Created April 18, 2023 23:14 — forked from davestewart/README.md
Decompile JavaScript from source maps

Decompile JavaScript from source maps

Overview

Modern JavaScript build tools compile entire folder structures of JavaScript code into single, minified files that are near-impossible to read, but can also include source maps which can be used to display the original code in tools such as the Chrome DevTools Sources panel.

These source maps can be processed to extract mainly meaningful code and file structures, by installing a package and running a simple bash command.

Generally, production builds shouldn't include source maps, but if you do manage to lose your source files, or for some (obviously, ethical!) reason need to view the original files, and you happen to have / find the source maps, you're good to go.

@sfabijanski
sfabijanski / README.md
Last active August 4, 2023 16:14
Calculating a bounding box from a location's latitude and longitude
@sfabijanski
sfabijanski / index.html
Last active October 11, 2023 20:57
Working example of Esri vector basemap. Example from taken from https://github.com/Leaflet/Leaflet.VectorGrid/blob/master/docs/demo-vectortiles.html
<!DOCTYPE html>
<html>
<head>
<title>VectorGrid.Protobuf example</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css" />
</head>