Skip to content

Instantly share code, notes, and snippets.

@shubhamp-sf
shubhamp-sf / all-aws-services.json
Created October 26, 2023 09:32
ALL AWS Services JSON
[{"title":"Analytics","services":[{"title":"Amazon AppFlow","abstract":"No-code integration for SaaS apps and AWS services"},{"title":"Amazon Athena","abstract":"Query data in Amazon S3 using SQL"},{"title":"AWS Clean Rooms","abstract":"Collaborate and analyze collective datasets without sharing raw data"},{"title":"Amazon CloudSearch","abstract":"Managed search service"},{"title":"AWS Data Exchange","abstract":"Find, subscribe to, and use third-party data in the cloud"},{"title":"AWS Data Pipeline","abstract":"Orchestration service for periodic, data-driven workflows"},{"title":"Amazon DataZone","abstract":"Unlock data across organizational boundaries with built-in governance"},{"title":"AWS Entity Resolution","abstract":"Link records stored across multiple applications, channels, and data stores"},{"title":"Amazon EMR","abstract":"Hosted Hadoop framework"},{"title":"Amazon FinSpace","abstract":"Store, catalog, prepare, and analyze financial industry data"},{"title":"AWS Glue","abstract":"Simple, scalable, a
@shubhamp-sf
shubhamp-sf / rmnodemodules.sh
Created March 22, 2023 10:35 — forked from cancerberoSgx/rmnodemodules.sh
remove node_modules and package-lock.json recursively
find . -name "node_modules" -exec rm -rf '{}' +; find . -name "package-lock.json" -exec rm -rf '{}' +;

Univeral Mixin for the Good

This approach is written keeping loopback4-soft-delete codebase in mind but should work for others having similar structure. Ideally when the only thing that class/mixin does is calling super.someMethod and is to be used with two or more different parent classes.

TLDR of the Solution

Remove all classes providing soft-crud for different underlying repository, change the type of base class being accepted by mixin to an explicit interface that only includes methods/properties that are actually of use in the mixin's code.)

Current Structure

The main exports in the package are SoftCrudRepositoryMixin, the SoftCrudRepository class and one for transaction repo. Aiming to serve the same purpose with different underlying class but with mixin it's possible to pass any other class as base having similar interface as DefaultCrudRepository from loopback.

@shubhamp-sf
shubhamp-sf / debug-loopback-applications-on-windows.md
Last active November 9, 2022 06:46
Debug Loopback Applications on Windows

Terminal: Git Bash OS: Windows

  1. Set DEBUG Variable With the value of application module you want to enable logging for, Checkout this string reference for more.
export DEBUG=loopback:core:application

Can also verify the value with echo

ENUM Example in Loopback 4 Model

Example file: user.model.ts

enum Role {
  SuperAdmin = 1,
  Admin,
  Subscriber
}
  1. install commitlint cli
npm install --save-dev @commitlint/config-conventional @commitlint/cli
  1. Add convention configuration to project
echo "module.exports = { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js