Skip to content

Instantly share code, notes, and snippets.

**/.DS_Store
dist
node_modules
npm-debug.log
README.md
LICENSE
Dockerfile*
docker-compose*
.dockerignore
.gitignore
save-prefix="~"
@justerror
justerror / nginx.conf
Last active July 26, 2021 11:27
NGINX configuration for Angular app
server {
listen 443 ssl http2;
server_name example.com www.example.com;
root /var/www/example.com/dist;
index index.html;
location / {
try_files $uri $uri/ @index;
add_header Cache-Control "no-cache, public, must-revalidate, proxy-revalidate";
}
type Entity<T> = T & { id: number | string };
export const trackById = <T>(index: number, item: Entity<T>) =>
item?.id ?? index;
@justerror
justerror / tsconfig.json
Created March 23, 2021 06:56 — forked from KRostyslav/tsconfig.json
tsconfig.json с комментариями.
// Файл "tsconfig.json":
// - устанавливает корневой каталог проекта TypeScript;
// - выполняет настройку параметров компиляции;
// - устанавливает файлы проекта.
// Присутствие файла "tsconfig.json" в папке указывает TypeScript, что это корневая папка проекта.
// Внутри "tsconfig.json" указываются настройки компилятора TypeScript и корневые файлы проекта.
// Программа компилятора "tsc" ищет файл "tsconfig.json" сначала в папке, где она расположена, затем поднимается выше и ищет в родительских папках согласно их вложенности друг в друга.
// Команда "tsc --project C:\path\to\my\project\folder" берет файл "tsconfig.json" из папки, расположенной по данному пути.
// Файл "tsconfig.json" может быть полностью пустым, тогда компилятор скомпилирует все файлы с настройками заданными по умолчанию.
// Опции компилятора, перечисленные в командной строке перезаписывают собой опции, заданные в файле "tsconfig.json".
@justerror
justerror / tslint.json
Created March 5, 2021 06:40
Configuration file for TSLint with Angular
{
"extends": ["tslint-config-prettier"],
"rulesDirectory": ["codelyzer"],
"rules": {
"angular-whitespace": [
true,
"check-interpolation",
"check-pipe",
"check-semicolon"
],
@justerror
justerror / style.css
Last active July 26, 2021 11:30
CSS scrollbar styling
/* Works on Firefox */
* {
scrollbar-width: thin; /* "auto" or "thin" */
scrollbar-color: blue orange; /* scroll thumb and track */
}
/* Works on Chrome/Edge/Safari */
::-webkit-scrollbar {
width: 12px; /* width of the entire vertical scrollbar */
height: 12px; /* height of the entire horizontal scrollbar */
@justerror
justerror / style.css
Last active March 4, 2021 15:24
Better cross browser font smoothing
body {
// Better cross browser font smoothing
text-rendering: optimizeLegibility;
font-variant-ligatures: none;
text-decoration-skip: objects;
text-size-adjust: 100%;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-tap-highlight-color: transparent;
}
@justerror
justerror / calc-scrollbar-width.js
Last active March 10, 2019 11:17 — forked from itrelease/calc-scrollbar-width.js
Calculate scrollbar width
/**
* @description Calculates scrollbar width
* @export
* @returns {number} Value in px
*/
export function calcScrollbarWidth(): number {
const outer = document.createElement('div');
outer.style.visibility = 'hidden';
outer.style.width = '100px';
outer.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps
@justerror
justerror / .stylelintrc
Last active October 15, 2021 09:06
Configuration file for stylelint
{
"extends": [
"stylelint-config-prettier"
],
"plugins": [
"stylelint-order",
"stylelint-scss"
],
"rules": {
"alpha-value-notation": "number",