Skip to content

Instantly share code, notes, and snippets.

View unlight's full-sized avatar
💭
Casting fireball

Roman Vasilev unlight

💭
Casting fireball
View GitHub Profile
@unlight
unlight / node topic questions.md
Last active March 23, 2021 06:55
node topic questions.md
  1. Отличные знания JavaScript на уровне текущей спецификации ESNext
  2. Общие знания по программной инженерии
  • ООП
  • функциональное и реактивное
  • программирование
  • обобщенное программирование
  • агрегация и композиция классов
  • модули и зависимости
  • инверсия управления и внедрение зависимостей
  • принципы
@unlight
unlight / frontend architecture layers.md
Last active February 9, 2024 20:16
frontend architecture layers
  1. API
  2. Container Components
  3. Dumb components
  4. UI (reusable everywhere)

Suffixes for sub apps

  • portal (e.g. etm.portal)
  • frontend
  • web
  • api (graphql)
@unlight
unlight / cqrs-notes.md
Last active April 9, 2022 11:56
cqrs eventsourcing
  1. Command: write, single handler, Event: past sense, many handlers
  2. Domain Events: Inside events, Integration events: Outside events (Outside from service, service boundrary)
  3. External Events == Integration Events != Domain Events
  4. Anti pattern CRUD sourcing: EntryUpdated, ProductCreated, ProductDeleted, etc. (use business value event: InventoryAdjusted, PriceIncreased. etc)
  5. Propery Sourcing: events like UserEmailChanged, UserNameChanged, etc.
@unlight
unlight / readme.md
Created January 18, 2021 18:10
Soft delete records SQL

How to

Soft delete records SQL

  • Use table RecycleBin with columns id, model, data
  • Move deleted records to RecycleBin
  • Serialize all rows to json and save to data
model Customer {
 customerId String @id @default(cuid())
@unlight
unlight / devtools custom url
Created June 27, 2020 10:35
devtools custom url
devtools://devtools/bundled/js_app.html?remoteBase=https://chrome-devtools-frontend.appspot.com/serve_file/@8f0c18b4dca9b6699eb629be0f51810c24fb6428/&dockSide=undocked
@unlight
unlight / bash join.sh
Created June 18, 2020 07:12
bash join
#!/usr/bin/env bash
function implode { local delimiter=$1; shift; printf "%s\n" "$@" | paste -sd"$delimiter" }
join_by '|' \
"a v" \
c \
"a"
@unlight
unlight / windows terminal npm.md
Created June 6, 2020 19:46
windows terminal npm
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
@unlight
unlight / feed.sql
Last active April 14, 2020 20:00
fee articles sql (multiple articles created by followed users, ordered by most recent first.)
// multiple articles created by followed users, ordered by most recent first.
SELECT `Article`.`id`,
`Article`.`slug`,
`Article`.`title`,
`Article`.`description`,
`Article`.`body`,
`Article`.`createdAt`,
`Article`.`updatedAt`,
`Article`.`favoritesCount`,
`Article`.`authorId`
@unlight
unlight / wsl.txt
Last active April 9, 2020 22:53
wsl.txt
# Using Ubuntu - upgrade nodejs
curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt install gcc g++ make
# show package
apt show PACKAGE
# upgrade
@unlight
unlight / sticky.txt
Last active February 19, 2020 19:04
sticky
https://codepen.io/moonformeli/pen/dyPxvZe#anon-login
https://github.com/google/angular-sticky-element/blob/master/src/app/sticky.element.directive.ts
https://github.com/raulromanp/ngSticky/blob/master/lib/sticky.js