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
| $layout-direction: ltr !default; | |
| @mixin ltr { | |
| @if $layout-direction == ltr { | |
| @content; | |
| } | |
| } | |
| @mixin rtl { | |
| @if $layout-direction == rtl { | |
| @content; |
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
| Пример: | |
| let a = parseUrl('http://tutu.ru:8080/do/any.php?a=1&b[]=a&b[]=b#foo') | |
| // Вернет объект, в котором будут следующие свойства: | |
| console.log( a.href == "http://tutu.ru:8080/do/any.php?a=1&b[]=a&b[]=b#foo" ) | |
| console.log( a.hash == "#foo" ) | |
| console.log( a.port == "8080" ) | |
| console.log( a.host == "tutu.ru:8080" ) | |
| console.log( a.protocol == "http:" ) |
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
| /* Basic example of save cookie using axios in node.js and recreate session if it expired. | |
| * Get/save cookie manually cause WithCredential axios param use XHR and not work in node.js | |
| * Supports parallel request and send only one create session request. | |
| * */ | |
| const BASE_URL = "https://google.com"; | |
| // Init instance of axios which works with BASE_URL | |
| const axiosInstance = axios.create({ baseURL: BASE_URL }); |
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
| // sending to sender-client only | |
| socket.emit('message', "this is a test"); | |
| // sending to all clients, include sender | |
| io.emit('message', "this is a test"); | |
| // sending to all clients except sender | |
| socket.broadcast.emit('message', "this is a test"); | |
| // sending to all clients in 'game' room(channel) except sender |
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
| function getWatchAngle(hours, minutes){ | |
| const minutesAngle = minutes * 360/60; | |
| const hourAngle = (hours%12 + minutes/60) * 360/12; | |
| return Math.abs(minutesAngle - hourAngle); | |
| } |
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
| # Define where to store the generated certs and metadata. | |
| DIR="$(pwd)/tls" | |
| # Optional: Ensure the target directory exists and is empty. | |
| rm -rf "${DIR}" | |
| mkdir -p "${DIR}" | |
| # Create the openssl configuration file. This is used for both generating | |
| # the certificate as well as for specifying the extensions. It aims in favor | |
| # of automation, so the DN is encoding and not prompted. |