Skip to content

Instantly share code, notes, and snippets.

📚 Vehicle Inspection API Documentation

🎯 Новая структура данных

Ключевое изменение: Каждая машина имеет индивидуальные параметры (service, appointment, location), но один инспектор на весь ордер.

Структура данных:

Order

param(
[int]$MouseJitterPx = 12,
[int]$ClickTestCount = 1,
[switch]$SkipNotepad
)
function Try-Run {
param([string]$Name, [scriptblock]$Code)
$ok = $true; $out = ""
try { $val = & $Code; if ($null -ne $val) { $out = ($val | Out-String) } }
@777genius
777genius / DioRefreshTokenInterceptor.dart
Created February 7, 2024 20:56
DioRefreshTokenInterceptor
import 'dart:io';
import 'package:dio/dio.dart';
import '../app_http_client.dart';
import '../app_http_client_token_refresher.dart';
import '../app_http_exception.dart';
import '../http_method.dart';
// TODO Ilya: lock all requests while refreshing token
@777genius
777genius / flutter_icons_generator.py
Last active April 21, 2022 14:17
Flutter svg icons generator to dart files with docs
import os
import re
# Relatively to "lib"
dartIconsPath = 'resources/icons/'
iconsDirectory = 'assets/icons/'
# Change string to lowerCamelCase
def to_camel(word):
class MyClass {}
void main() {
const className = MyClass;
print(className());
}
@777genius
777genius / _breakpoints.sass
Created July 31, 2019 18:28
Bootstrap media mixins (.sass)
// Breakpoint viewport sizes and media queries.
//
// Breakpoints are defined as a map of (name: minimum width), order from small to large:
//
// (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)
//
// The map defined in the `$grid-breakpoints` global variable is used as the `$breakpoints` argument by default.
// Name of the next breakpoint, or null for the last breakpoint.
//
@777genius
777genius / swipe.js
Created December 30, 2018 14:11
An example of using swipe on mobile devices.
// at least 100 px are a swipe
// you can use the value relative to screen size: window.innerWidth * .1
const offset = 100;
let xDown, yDown
window.addEventListener('touchstart', e => {
const firstTouch = getTouch(e);
xDown = firstTouch.clientX;
yDown = firstTouch.clientY;
(89.99999999999999 !== 90.00000000000000) !== (89.999999999999999 !== 90.000000000000000)
@777genius
777genius / getSrcDir.js
Last active December 1, 2018 19:23
Find source (src) or another folder path going up the Hierarchy.
const { join } = require('path')
export function getSrcDir (srcFolder = 'src', startPath = __dirname) {
const parentPath = normalize(startPath + '/..')
if (startPath === parentPath) {
throw Error('Could not find folder.')
}
if (basename(startPath) === srcFolder) {
@777genius
777genius / timezones.json
Created October 19, 2018 02:30
All world timezones with countries codes and offsets.
{"data":
[{"name":"Africa/Conakry","countryCode":"GIN","offset":"(UTC+00:00)","offsetPrefix":"+"},{"name":"Africa/Lome","countryCode":"TGO","offset":"(UTC+00:00)","offsetPrefix":"+"},{"name":"Atlantic/Reykjavik","countryCode":"ISL","offset":"(UTC+00:00)","offsetPrefix":"+"},{"name":"Africa/Monrovia","countryCode":"LBR","offset":"(UTC+00:00)","offsetPrefix":"+"},{"name":"America/Scoresbysund","countryCode":"GRL","offset":"(UTC+00:00)","offsetPrefix":"+"},{"name":"America/Danmarkshavn","countryCode":"GRL","offset":"(UTC+00:00)","offsetPrefix":"+"},{"name":"Africa/Bissau","countryCode":"GNB","offset":"(UTC+00:00)","offsetPrefix":"+"},{"name":"Africa/Banjul","countryCode":"GMB","offset":"(UTC+00:00)","offsetPrefix":"+"},{"name":"Africa/Bamako","countryCode":"MLI","offset":"(UTC+00:00)","offsetPrefix":"+"},{"name":"Africa/Dakar","countryCode":"SEN","offset":"(UTC+00:00)","offsetPrefix":"+"},{"name":"Africa/Ouagadougou","countryCode":"BFA","offset":"(UTC+00:00)","offsetPrefix":"+"},{"name":"Africa/Accra","countryCo