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, useCallback, useRef } from 'react'; | |
| function useWebSocket(url) { | |
| const [isConnected, setConnected] = useState(false); | |
| const [socket, setSocket] = useState(null); | |
| const isReconnectionEnable = useRef(true); | |
| const setReconnectionEnable = useCallback((newValue) => { | |
| isReconnectionEnable.current = newValue; | |
| }, []); |
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
| extension UIView { | |
| func bounceAnimationX(angle: Double, speed: Double = 1) { | |
| var inTransform = CATransform3DIdentity; | |
| inTransform.m34 = 1.0 / 1000.0; | |
| inTransform = CATransform3DRotate(inTransform, CGFloat(angle * Double.pi / 180), 0, 1, 0) | |
| var outTransform = CATransform3DIdentity; | |
| outTransform.m34 = 1.0 / 500.0; | |
| outTransform = CATransform3DRotate(outTransform, 0, 0, 1, 0) | |
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
| version: "3" | |
| services: | |
| nginx-proxy: | |
| image: jwilder/nginx-proxy | |
| restart: always | |
| ports: | |
| - 80:80 | |
| - 443:443 | |
| volumes: | |
| - /var/run/docker.sock:/tmp/docker.sock:ro |