Required software:
import Combine | |
import UIKit | |
struct Agent { | |
struct Response<T> { | |
let value: T | |
let response: URLResponse | |
} | |
func run<T: Decodable>(_ url: URL, _ decoder: JSONDecoder = JSONDecoder()) -> AnyPublisher<Response<T>, Error> { |
import { useCallback, useContext } from "react"; | |
import axios, { AxiosError, AxiosResponse } from "axios"; | |
import { UserContext } from "modules/AuthManager/userContext"; | |
export const useFetch = () => { | |
const { removeToken, token } = useContext(UserContext); | |
const getResponse = useCallback( | |
( | |
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", |
/* eslint-disable no-console */ | |
// goal: debug props changes (performance analysis) | |
// alternative for https://github.com/welldone-software/why-did-you-render | |
// usage: memo(someComponent, arePropsEqualDebug(someComponent.name) | |
// read more: https://reactjs.org/docs/react-api.html#reactmemo | |
// tip: use console.count() for getting a number of renders | |
function areEqualShallow(a: any, b: any) { | |
for(var key in a) { |
import HealthKit | |
import UserNotifications | |
import Combine | |
@main | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
unc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
// ask the user for notification permissions | |
Docker network issues when using Rancher Desktop on Mac with Apple Silicon ARM-based processor (M1 chip)
When pulling image (e.g. docker run hello-world
) or signing to the Docker Hub (docker login
) the following error occurs:
Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io.
To fix the issue, change DNS server adress for the linux virtual machine instance: lime-vm
Run in Terminal:
brew install wimlib
- run, ifwimlib
is not installed yet (required for splitting large files)- To identify target USB device, run:
diskutil list
- Format USB drive:
diskutil eraseDisk MS-DOS "$WIN_USB_NAME" MBR /dev/$DISK
where$WIN_USB_NAME
is a new volume name (e.g. WIN) and$DISK
is a target disk identificator (e.g. disk5). Alternatively, you can tryGTP
partititon style instead ofMBR
(recommended for UEFI = newer Windows distributions) - To mount Windows installer image, run:
hdiutil mount ~/Desktop/$WIN_INSTALLER_IMAGE.iso
where $WIN_INSTALLER_IMAGE is installer image name. - Copy all files to the USB drive, beside the "install" file (if it's over 4GB size):
rsync -vha --exclude=sources/install.$EXT /Volumes/$WIN_INSTALLER_NAME/ /Volumes/$WIN_USB_NAME
where $EXT iswim
oresd
, $WIN_INSTALLER_NAME is the mounted Windows installer volume name and $WIN_USB_NAME is target disk name.
- Open any document in Preview app (e.g. any PDF file).
- From system top menu, choose:
File > Print...
- From print dialogue, choose
Page Size
>Manage Custom Sizes
. - Add new profile with the following values:
- Width:
209,9
- Height:
297,04
- Margins:
User Defined
- Top, Bottom, Left, Right:
0
- Set profile as a default:
System Settings
>Printers & Scanners
>Default paper size
Source: https://dashcamtalk.com/forum/threads/how-to-disable-power-up-sound.45398/post-559083
Connect to the dvr's wi-fi network. Launch any telnet client. For example "Mobile Telnet" (https://play.google.com/store/apps/details?id=mobiletelnet.feng.gao) ⋮ -> "Telnet Settings" -> Remote Host Name: "192.168.0.1", port: "23" (by default) ⋮ -> "Connect".... The inscription "NVTEAM login" will appear: Write "root", press "enter" Enter the command (rename the turn-on sound) and press "enter": Code: mv /mnt/app/res/voice/public/bootsound.raw /mnt/app/res/voice/public/bootsound_1.raw