const arr = [1,2,3];
arr.map(x => 2*x);
arr.filter(x => x % 2 == 0);
arr = [1,2,3]
[2*x for x in arr]
#!/bin/bash | |
isPackageManagerSpecified="false"; | |
for ((i=1; i<=$#; i++)) | |
do | |
nextArgumentIndex=$((i+1)); | |
if [[ "${!i}" == "--package-manager" ]] && [[ "${!nextArgumentIndex}" == "pnpm" ]]; | |
then | |
isPackageManagerSpecified="true"; | |
fi |
" set autoindent | |
" reload files when changed on disk, i.e. via `git checkout` | |
set autoread | |
" Fix broken backspace in some setups | |
set backspace=2 | |
" see :help crontab | |
set backupcopy=yes | |
" yank and paste with the system clipboard | |
set clipboard=unnamed | |
" don't store swapfiles in the current directory |
Please note that this script disclose too much data. You can filter them by using filter-env lib. In that case you can add a specific prefix to all of your envs. The other point is that this script uses the same env name as it is inside the .env
file, so my suggestion to
Docker* | |
**/*.tsbuildinfo | |
.DS_STORE | |
# Angular app specific | |
.angular | |
/dist/ | |
/build/ |
{ | |
"arrowParens": "always", | |
"useTabs": false, | |
"bracketSpacing": true, | |
"endOfLine": "lf", | |
"printWidth": 70, | |
"quoteProps": "consistent", | |
"tabWidth": 4, | |
"trailingComma": "all", | |
"semi": true, |
export const FlightRegionType: { | |
DOMESTIC: 'DOMESTIC', | |
INTERNATIONAL: 'INTERNATIONAL' | |
}; | |
export const CabinClass: { | |
ECONOMY: 'ECONOMY', | |
BUSINESS: 'BUSINESS', | |
FIRST: 'FIRST' | |
}; |
# Connect to postgres | |
PGPASSWORD="pass" psql -h localhost -p 5432 -U user -d db-name | |
# You can also use .pgpass, TBH it does not work in my experience. BTW this is much much safer from point of security - No track in terminal history. | |
touch ~/.pgpass | |
# Replace its values: | |
db_host:db_port:db_name:db_user:db_pass | |
# Dump from postgres | |
# Doc: https://www.postgresql.org/docs/14/app-pgdump.html |
import { Module } from '@nestjs/common'; | |
import { ThrottlerModule } from '@nestjs/throttler'; | |
import { ThrottlerStorageRedisService } from 'nestjs-throttler-storage-redis'; | |
import { AppService } from './service/app.service'; | |
import { AppController } from './app.controller'; | |
import { APP_GUARD } from '@nestjs/core'; | |
import { GlobalThrottlerGuard } from './guards/global-throttler.guard'; | |
@Module({ |
// This is your Prisma schema file | |
// learn more about it in the docs: https://pris.ly/d/prisma-schema | |
// N:M relationship in prisma | |
datasource db { | |
provider = "postgres" | |
url = env("DATABASE_URL") | |
} | |
generator client { |