Sample codes in this blog. https://dev.to/paprikamah/how-to-setup-aws-waf-v2-21f1
name: Unit Test | |
on: | |
push: | |
branches: [develop] | |
pull_request: | |
branches: [master, develop] | |
jobs: | |
PHPUnit: |
name: backup-mysql | |
on: | |
schedule: | |
# Run at 7:00 UTC every day | |
- cron: "0 7 * * *" | |
jobs: | |
run_mysqldump: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Dump database |
# Let us consider the following typical mysql backup script: | |
mysqldump --routines --no-data -h $mysqlHost -P $mysqlPort -u $mysqlUser -p$mysqlPassword $database | |
# It succeeds but stderr will get: | |
# Warning: Using a password on the command line interface can be insecure. | |
# You can fix this with the below hack: | |
credentialsFile=/mysql-credentials.cnf | |
echo "[client]" > $credentialsFile | |
echo "user=$mysqlUser" >> $credentialsFile | |
echo "password=$mysqlPassword" >> $credentialsFile |
Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.
NOTE: This logic can be extended to more than two accounts also. :)
The setup can be done in 5 easy steps:
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
</head> | |
<body> | |
<style> | |
.content { |
server { | |
listen 80; | |
listen [::]:80; | |
index index.html; | |
server_name your-domain.com; | |
location / { | |
proxy_pass http://localhost:3000; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; |
import { ValidationArguments, ValidatorConstraintInterface } from 'class-validator'; | |
import { Connection, EntitySchema, FindConditions, ObjectType } from 'typeorm'; | |
interface UniqueValidationArguments<E> extends ValidationArguments { | |
constraints: [ | |
ObjectType<E> | EntitySchema<E> | string, | |
((validationArguments: ValidationArguments) => FindConditions<E>) | keyof E, | |
]; | |
} |
import { defineStore } from 'pinia' | |
export const useAuthStore = defineStore({ | |
id: 'auth', | |
state: () => ({ | |
isAuthenticated: false, | |
user: null | |
}), | |
actions: { | |
async nuxtServerInit() { |
This is an example of how to ignore a global validation pipe for a specific parameter, e.g. a request body. In fact, this example just shows a request body but you could apply this principle to other decorators.
This approach assumes validateCustomDecorators: false
in the global validation pipe. If validateCustomDecorators
is true in the global pipe I think you're out of luck. If that is your situation, consider refactoring so that validateCustomDecorators
is false in the global pipe and then have each custom decorator add validation if it needs it.
The NestJS ValidationPipe
does not validate custom decorators. So, in this above example we just make a @RawBody()
param decorator, and NestJS will skip validating it.