Skip to content

Instantly share code, notes, and snippets.

@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
}
@sisyphushappy
sisyphushappy / docker-stack.ts
Created May 24, 2022 04:11
Build a docker image asset, deploy it to ECR, and update a file in a remote GitHub repo with the docker image asset hash
import {Duration, Stack, StackProps} from "aws-cdk-lib";
import {Construct} from "constructs";
import {Repository} from "aws-cdk-lib/aws-ecr";
import {Function, LayerVersion, Runtime} from "aws-cdk-lib/aws-lambda";
import {ArnPrincipal, Effect, ManagedPolicy, PolicyStatement} from "aws-cdk-lib/aws-iam";
import {PythonFunction} from "@aws-cdk/aws-lambda-python-alpha";
import {DockerImageAsset} from "aws-cdk-lib/aws-ecr-assets";
import * as path from "path";
import * as ecrdeploy from 'cdk-ecr-deployment';
import {Secret} from "aws-cdk-lib/aws-secretsmanager";
@ceving
ceving / ancestors.js
Last active May 29, 2023 05:05
JavaScript ancestor class list
/**
* Returns the list of ancestor classes.
*
* Example:
* ancestors(HTMLElement) .map (e => e.name || e.constructor.name)
* => [ "HTMLElement", "Element", "Node", "EventTarget", "Function", "Object" ]
*/
function ancestors (anyclass)
{
switch (true) {
@cancerberoSgx
cancerberoSgx / rmnodemodules.sh
Last active January 2, 2024 21:30
remove node_modules and package-lock.json recursively
find . -name "node_modules" -exec rm -rf '{}' +; find . -name "package-lock.json" -exec rm -rf '{}' +;