Skip to content

Instantly share code, notes, and snippets.

@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>
@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 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
Last active August 4, 2023 16:14
Calculating a bounding box from a location's latitude and longitude
@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 / example_polygon_clip_toolbox.pyt
Created April 24, 2020 21:03
A basic Esri Python Toolbox which takes an input polygon and clips a network stored featureclass that icludes parcels features, returning the clipped features back to the caler.
# A basic Python Toolbox script that takes a polygon as input and returns back
# a collection of parcel features clipped by the incoming polygon
# refer to https://gist.github.com/sfabijanski/b599ad795c0f573d88202e122ab19275 for information
# on the polygon template
# import arcpy
from arcpy import (
AddMessage,
da,
Delete_management,
Dissolve_management,
@sfabijanski
sfabijanski / vs_code_azure_functions_on_fedora_30.md
Created June 28, 2019 18:31
Setting VS Code to use Azure Function extension on Fedora 30

Getting Started with Azure Functions in VS Code on a Fedora 30 workstation

The Azure Functions extension requires the installation of .Net Core to run properly and the Azure Functions Core Tools. These instructions walk through the proper steps required to get extension running properly on a Fedora 30 workstation.

First ensure .Net Core is in place

dotnet --version

The install for the Function Core Tools requires at least the 2.2 SDK

Installing the .Net core SDK from a Copr Repository

@sfabijanski
sfabijanski / sql_table_info.sql
Last active October 26, 2018 14:25
A script to size up the tables in your SQL Server database
-- pulled from: https://stackoverflow.com/questions/7892334/get-size-of-all-tables-in-database
SELECT
t.NAME AS TableName,
s.Name AS SchemaName,
p.rows AS RowCounts,
SUM(a.total_pages) * 8 AS TotalSpaceKB,
CAST(ROUND(((SUM(a.total_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS TotalSpaceMB,
SUM(a.used_pages) * 8 AS UsedSpaceKB,
CAST(ROUND(((SUM(a.used_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS UsedSpaceMB,
@sfabijanski
sfabijanski / app.js
Created June 2, 2018 13:55 — forked from raddeus/app.js
Basic Express 4.0 Setup with connect-flash
var express = require('express');
var session = require('express-session');
var cookieParser = require('cookie-parser');
var flash = require('connect-flash');
var app = express();
app.use(cookieParser('secret'));
app.use(session({cookie: { maxAge: 60000 }}));
app.use(flash());
@sfabijanski
sfabijanski / example.iisnode.yml
Created May 23, 2018 21:24
Example iisnode.yml file that sets node_env to production, overriding the local web.config file.
# ============================================================================
# Make a copy of this file and name it iisnode.yml if you want to use it for overrides.
# ============================================================================
# The optional iisnode.yml file provides overrides of the iisnode configuration settings specified in web.config.
# node_env - determines the environment (production, development, staging, ...) in which
# child node processes run; if nonempty, is propagated to the child node processes as their NODE_ENV
# environment variable; the default is the value of the IIS worker process'es NODE_ENV
# environment variable