Skip to content

Instantly share code, notes, and snippets.

@RoyalHunt
RoyalHunt / tsconfig.json
Created January 31, 2022 20:26 — 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".
@RoyalHunt
RoyalHunt / mac-setup-redis.md
Created June 13, 2021 13:30 — forked from tomysmile/mac-setup-redis.md
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@RoyalHunt
RoyalHunt / gist:f6e385cc85b7d9599767afbd93fee2a7
Created June 27, 2020 20:39
как найти файл который создает глобальную переменную
Берем файл который гарантированно выполяется самый-самый первый и пишем
Object.defineProperty(window, 'demo', { get() {}, set() { debugger; } })
и как только кто-то определит (ок, на самом деле первый раз присвоит) переменную demo вас выкинет в дебаггер, где будет стек в нужный файл
@RoyalHunt
RoyalHunt / css
Created May 12, 2020 14:41
Visual grid for grid layout
/* Grid */
.grid::before {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
content: '';
pointer-events: none;
function lightenDarkenColor(color, amt, isDarken) {
let col = color;
let usePound = false;
const diff = isDarken ? ~amt + 1 : amt;
if (col[0] === '#') {
col = col.slice(1);
usePound = true;
}
@RoyalHunt
RoyalHunt / bundle.jsx
Created August 20, 2018 11:00
Example for code review
// @flow
import * as React from 'react';
import styled from 'react-emotion';
import { Transition, config, animated } from 'react-spring';
import { compose, lifecycle, branch, renderComponent, withHandlers, pure } from 'recompose';
import { connect } from 'react-redux';
import Swipeable from 'react-swipeable';
import { actions as routerActions } from 'redux-router5';
docker ps --format "table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}"
@RoyalHunt
RoyalHunt / myscript.sh
Created May 18, 2018 21:40 — forked from bradtraversy/myscript.sh
Basic Shell Scripting
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
@RoyalHunt
RoyalHunt / gist:95fc9949d8cdbba4aaba6d6354720478
Last active April 27, 2018 12:32
IOS input fix with user-select: none
/*
This is for demonstration purposes. Ideally, you should never use the star selector.
I recommend that you use this early on in your development, and then once you've established
your HTML element palette, go back and replace * with a comma-separated list of your
tag names. Additionally, the !important shouldn't have to be used, but I'm leaving it here
because some enterprising goons will probably copy and paste this directly into their project -
the !important will ensure these settings override other attempts that were either never
deleted or are part of an installed CSS file the user is unaware of.
*/
* {
@RoyalHunt
RoyalHunt / gist:b07ea0c71d4c9adf1810f9e30717cf22
Created April 2, 2018 20:39
update all documents in mongodb
const test = await User.find()
test.forEach(async (doc) => {
const id = nanoid()
await User.update({ _id: doc._id }, { $set: { id } })
})