Skip to content

Instantly share code, notes, and snippets.

View szul's full-sized avatar
💻

Michael Szul szul

💻
View GitHub Profile
@szul
szul / tsconfig.json
Created February 12, 2022 14:03
Stricter TypeScript configuration
{
"compilerOptions": {
"target":"es6",
"module": "commonjs",
"declaration": true,
"sourceMap": true,
"outDir": "./lib",
"rootDir": "./src",
"types": [
"node"
@ECHO off
:top
CLS
ECHO Choose a shell:
ECHO [1] cmd
ECHO [2] bash
ECHO [3] PowerShell
ECHO [4] PowerShell Core
ECHO [5] Python
ECHO.
name: DEV CI
on:
push:
branches: [dev]
paths:
- 'apps/my-app/**'
pull_request:
branches: [dev]
paths:
@szul
szul / iisnode.yml
Created August 14, 2020 17:43
Example IISNode YAML file
node_env: "production"
nodeProcessCommandLine: "C:\Program Files\nodejs\node.exe --no-deprecation --no-warnings"
promoteServerVars: "HTTP_UID,LOGON_USER"
nodeProcessCountPerApplication: 4
debugHeaderEnabled: true
devErrorsEnabled: true
@szul
szul / iisnode.web.config
Created August 14, 2020 17:39
Example Web.config for IISNode
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
</appSettings>
<system.webServer>
<rewrite>
<rules>
<rule name="StaticContent" stopProcessing="true">
<match url="([\S]+[.](jpg|jpeg|gif|css|png|ts|cscc|less|ico|html|map|svg))" />
<action type="None" />
@szul
szul / launch.json
Created April 3, 2020 12:51
VSCode Launch
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch LMS Program",
@szul
szul / tasks.json
Created April 3, 2020 12:51
VSCode Build
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build-lms",
"options": {
"cwd": "${workspaceFolder}/apps/lms"
},
@szul
szul / index.html
Created November 14, 2019 13:09 — forked from ThomasG77/index.html
Simple OpenLayers Reverse Geocoding sample with Nominatim
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<meta name=description content="">
<meta name=viewport content="width=device-width, initial-scale=1">
<title>Reverse geocoding</title>
<link rel="stylesheet" href="https://openlayers.org/en/v4.4.2/css/ol.css" type="text/css">
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL,fetch"></script>

Serving Flask under a subpath

Your Flask app object implements the __call__ method, which means it can be called like a regular function. When your WSGI container receives a HTTP request it calls your app with the environ dict and the start_response callable. WSGI is specified in PEP 0333. The two relevant environ variables are:

SCRIPT_NAME
The initial portion of the request URL's "path" that corresponds to the application object, so that the application knows its virtual "location". This may be an empty string, if the application corresponds to the "root" of the server.

@szul
szul / howto_python_flask_iis_wfastcgi
Created May 23, 2019 20:16 — forked from bparaj/howto_python_flask_iis_wfastcgi
Python Flask on IIS with wfastcgi
Assume IIS is installed. My machine already had IIs 8.5.
Install Python
==============
1. Download web installer (Python 3.6.3).
2. Run as Administrator.
3. Select custom installation for all users.
4. Choose install directory such that there are no white spaces in the path. Not sure if it needs to be done. Just being cautious.
5. Check the box for "Add Python 3.6 to PATH".