npm i -g @nestjs/cli
nest new tasks-api
npm run start:dev
nest g mo tasks
import 'package:flutter/material.dart'; | |
import 'package:get/get.dart'; | |
void main() { | |
runApp(GetMaterialApp(home: Home())); | |
} | |
class Home extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { |
def localProperties = new Properties() | |
def localPropertiesFile = rootProject.file('local.properties') | |
if (localPropertiesFile.exists()) { | |
localPropertiesFile.withReader('UTF-8') { reader -> | |
localProperties.load(reader) | |
} | |
} | |
def flutterRoot = localProperties.getProperty('flutter.sdk') | |
if (flutterRoot == null) { |
<?php | |
//正数 客户端=警告,客户端展示错误信息但不重试请求、 负数 客户端=错误,客户端重试 | |
//系统和公共错误 | |
define('ERROR_PARAMETER', -1001); //参数错误 | |
define('DB_EXEC_ERROR', -1002); //数据库执行失败 | |
define('ERROR_APP_VERSION', -1003); //版本与服务器不一致 | |
define('SERVER_MAINTENANCE', -1004); //服务器维护中 | |
define('REDIS_KEY_NOT_IDENTIFY', -1005); //未定义的redis key | |
define('SOCKET_TOKEN_WRONG', -1006); //错误的webSocket访问token |
var engine_js = { | |
"ErrorCode.-128": "Internal engine error", | |
"ErrorCode.-1": "Unknown error", | |
"ErrorCode.0": "Unknown error", | |
"ErrorCode.1": "Some data is not correctly specified.", | |
"ErrorCode.2": "The resource could not be found.", | |
"ErrorCode.3": "Resource already exists.", | |
"ErrorCode.4": "Invalid path", | |
"ErrorCode.5": "Access is denied", | |
"ErrorCode.6": "The system is out of memory.", |
import 'dart:async'; | |
import 'package:flutter/foundation.dart'; | |
void main() { | |
FutureOr<void> tryCatchLoop({ | |
@required FutureOr<void> Function() code, | |
@required FutureOr<void> Function(dynamic error) onError, | |
Duration duration = const Duration(milliseconds: 200), int limitTimes = 5 | |
}) async { | |
int count = 0; |
{ | |
"firestore": { | |
"rules": "firestore.rules", | |
"indexes": "firestore.indexes.json" | |
}, | |
"emulators": { | |
"firestore": { | |
"port": 8080 | |
} | |
} |
# Install dependencies only when needed | |
FROM node:18-alpine3.15 AS deps | |
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. | |
RUN apk add --no-cache libc6-compat | |
WORKDIR /app | |
COPY package.json yarn.lock ./ | |
RUN yarn install --frozen-lockfile | |
# Build the app with cache dependencies | |
FROM node:18-alpine3.15 AS builder |
@IsString() | |
@MinLength(6) | |
@MaxLength(50) | |
@Matches( | |
/(?:(?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/, { | |
message: 'The password must have a Uppercase, lowercase letter and a number' | |
}) | |
password: string; |
import { createStore } from 'vuex'; | |
// My custom modules | |
import exampleModule from './module-template'; | |
import { ExampleStateInterface } from './module-template/state'; | |
export interface StateInterface { | |
// Define your own store structure, using submodules if needed | |
// example: ExampleStateInterface; |