Set of statistics functions for simple analysis.
npm i gist:acb7729589f6ef734449c483045efe0c| import winston from 'winston'; | |
| import morgan from 'morgan'; | |
| import json from 'morgan-json'; | |
| /* WINSTON */ | |
| const filterLevel = level => winston.format(info => info.level === level ? info : undefined)(); | |
| const logger = winston.createLogger({ | |
| levels: { error: 0, warn: 1, info: 2, debug: 3, http: 4 }, | |
| transports: [ |
| tap "homebrew/bundle" | |
| # BASIC SOFTWARE --> | |
| brew "mas" | |
| # mas "Slack", id: 803453959 | |
| mas "The Unarchiver", id: 425424353 | |
| mas "Spark", id: 1176895641 | |
| mas "Dropover", id: 1355679052 | |
| mas "Bitwarden", id: 1352778147 | |
| cask "rectangle" |
| import os | |
| import json | |
| from http.server import BaseHTTPRequestHandler, HTTPServer | |
| from urllib import parse | |
| from requests import post | |
| port = os.environ['PROXY_PORT'] | |
| url = os.environ['FORWARD_URL'] | |
| token = os.environ['TOKEN'] |
| """ Functional module """ | |
| from typing import List, Dict, Callable, TypeVar, Optional | |
| T = TypeVar('T') | |
| U = TypeVar('U') | |
| def map(predicate: Callable[[T], U], items: List[T]) -> List[U]: | |
| ''' | |
| Applies a given function to all items in the list and returns a new list | |
| containing the results. |
| import { useState, useEffect } from 'react'; | |
| export type TimeoutOptions = { | |
| initial: number; | |
| auto?: boolean; | |
| interval?: number; | |
| onFinish?: () => void; | |
| }; | |
| export const useTimeout = (options?: TimeoutOptions) => { |
| # PEP 561 stub marker |
| export type Unit = 'acre' | 'bit' | 'byte' | 'celsius' | 'centimeter' | 'day' | 'degree' | 'fahrenheit' | 'fluid-ounce' | 'foot' | 'gallon' | 'gigabit' | 'gigabyte' | 'gram' | 'hectare' | 'hour' | 'inch' | 'kilobit' | 'kilobyte' | 'kilogram' | 'kilometer' | 'liter' | 'megabit' | 'megabyte' | 'meter' | 'microsecond' | 'mile' | 'mile-scandinavian' | 'milliliter' | 'millimeter' | 'millisecond' | 'minute' | 'month' | 'nanosecond' | 'ounce' | 'percent' | 'petabyte' | 'pound' | 'second' | 'stone' | 'terabit' | 'terabyte' | 'week' | 'yard' | 'year'; | |
| export type FormatOptions = { | |
| currency?: string; | |
| units?: 'short' | 'narrow' | 'long'; | |
| sign?: boolean; | |
| integers?: number; | |
| decimals?: number; | |
| round?: 'ceil' | 'floor' | 'expand' | 'trunc'; | |
| notation?: 'standard' | 'scientific' | 'engineering' | 'compact'; |
| """Unit conversion""" | |
| from dataclasses import dataclass | |
| from functools import total_ordering | |
| from enum import Enum | |
| from typing import Callable, NamedTuple | |
| class UnitDesc(NamedTuple): | |
| """Unit description""" | |
| scale: float |