This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # macOS | |
| .DS_Store | |
| # Environments | |
| .env | |
| .env.* | |
| !.env.*.sample | |
| # Logs | |
| logs/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """A simple implementation for a dataclass decorator in micropython""" | |
| # pylint: disable=line-too-long | |
| from typing import Callable, Type, TypeVar, Any, Tuple | |
| from builtins import repr as brepr | |
| T = TypeVar("T") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export type Storable = | |
| | string | |
| | number | |
| | boolean | |
| | null | |
| | Date | |
| | Storable[] | |
| | undefined | |
| | { [key: string]: Storable }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import type { Map, IControl } from 'mapbox-gl'; | |
| import useTerrain, { type ExtrusionOptions } from './terrain'; | |
| import type { Prettify } from '/@/types/utilities'; | |
| export type TerrainControlOptions = Prettify<{ | |
| init?: boolean, | |
| pitch?: number; | |
| } & ExtrusionOptions>; | |
| export default class TerrainControl implements IControl { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import List, Type, TypeVar | |
| T = TypeVar("T", bound="Autoparser") | |
| class Autoparser: | |
| """Automatic parse into parseable classes.""" | |
| def __repr__(self): | |
| exclude = (classmethod,) | |
| attrs = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Minimal pyboard.py implementation for communicating with MicroPython boards | |
| """ | |
| import os | |
| import time | |
| import re | |
| import serial | |
| import serial.tools.list_ports |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useState, useEffect } from 'react'; | |
| export type TimeoutOptions = { | |
| initial: number; | |
| auto?: boolean; | |
| interval?: number; | |
| onFinish?: () => void; | |
| }; | |
| export const useTimeout = (options?: TimeoutOptions) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ 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. |
NewerOlder