Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| import sys | |
| from http.server import SimpleHTTPRequestHandler, HTTPServer | |
| class GzipRequestHandler(SimpleHTTPRequestHandler): | |
| '''HTTPRequestHandler for gzip files''' | |
| def end_headers(self): | |
| '''Set Content-Encoding: gzip for gzipped files''' | |
| if self.path.endswith('.gz'): |
o===============================================================================oo===============================================================================o | . . . . || . . . . | | : : : : || : : : : | | : . : . : . : || : . : . : . : | | .' . . .' . . .' . . .' . || .' . . .' . . .' . . .' . |
| import http.server | |
| import http.cookiejar | |
| import io | |
| import socket | |
| from http import HTTPStatus | |
| import ssl | |
| import os | |
| import zlib | |
| server_address = ('0.0.0.0', 4443) |
The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.
This means you have the following choices:
import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.await import(…) from CommonJS instead of require(…).This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
| // A loading spinner with 6 dots. | |
| // By @marcedwards from @bjango. | |
| // | |
| // Pretty messy and hacked together, but it works. ¯\_(ツ)_/¯ | |
| // Created using Processing 3.3.7. | |
| float scaler = 0.24 * 4; // Scale the entire design. | |
| float scalerb = 4; // Scale the entire design more. | |
| int frame = 0; |
| const fs = require('fs'); | |
| const PNG = require('pngjs').PNG; | |
| /* | |
| Utilities | |
| ========= | |
| */ | |
| const PNG_OPTIONS = { | |
| GRAYSCALE_AND_ALPHA: 4, |