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
| 192 | |
| If you are using Apache as your web server, you can insert this into your .htaccess file: | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteRule ^index\.html$ - [L] | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d |
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
| // В атрибут value можно передать массив, что позволит выбрать несколько опций в теге select: | |
| <select multiple={true} value={['Б', 'В']} | |
| // Boolean attribute 'multiple' indicates that multiple options can be selected in the list. | |
| // If it is not specified, then only one option can be selected at a time. When `multiple` is | |
| // specified, most browsers will show a scrolling list box instead of a single line dropdown. |
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
| // Object with arbitrary string properties (like a hashmap or dictionary) | |
| { [key: string]: Type; } | |
| { [key: number]: Type; } | |
| { [key: symbol]: Type; } | |
| { [key: `data-${string}`]: Type; } | |
| /* | |
| Индексные типы позволяют определить тип данных для ключей объекта, которые могут быть строками, числами, символами | |
| или определенным шаблоном строк. |
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 tuples | |
| let myTuple: [ string, number, boolean? ]; | |
| myTuple = [ 'test', 42 ]; |
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; | |
| let b = 1; | |
| // assign a value only if current value is truthy | |
| a &&= 'default'; // a is still undefined | |
| b &&= 5; // b is now 5 |
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; | |
| let b = 0; | |
| // assign a value only if current value is null or undefined | |
| a ??= 'default'; // a is now 'default' | |
| b ??= 5; // b is still 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
| // Overloads | |
| function conv(a: string): number; | |
| function conv(a: number): string; | |
| function conv(a: string | number): string | number { | |
| // ... | |
| } |
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
| https://stackoverflow.com/questions/5651654/ffmpeg-how-to-split-video-efficiently - VIDEO SPLIT | |
| time ffmpeg -v quiet -y -i input.ts -vcodec copy -acodec copy -ss 00:00:00 -t 00:30:00 -sn test1.mkv | |
| time ffmpeg -v quiet -y -i input.ts -vcodec copy -acodec copy -ss 00:30:00 -t 01:00:00 -sn test2.mkv |
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
| Conditionally adding entries inside Array and object literals | |
| http://2ality.com/2017/04/conditional-literal-entries.html |
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
| padding: min(85%, 9.75em) 0; |