Skip to content

Instantly share code, notes, and snippets.

@Adrek
Adrek / main.dart
Created July 11, 2021 17:59 — forked from eduardoflorence/main.dart
GetX - Sample TabBar
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) {
@Adrek
Adrek / type-orm_nestjs.md
Created October 25, 2021 03:16 — forked from nicobytes/type-orm_nestjs.md
Steps: TypeOrm + NestJs

1. Create project

npm i -g @nestjs/cli
nest new tasks-api
npm run start:dev

2. Overview and delete files

3. Create module

nest g mo tasks
@Adrek
Adrek / build.gradle
Created November 13, 2021 00:38 — forked from Klerith/build.gradle
Flutter: Build para 32 bit y 64 bits - Curso de Flutter fernando-herrera.com
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.",
@Adrek
Adrek / try_catch_loop.dart
Created April 14, 2022 23:27 — forked from JosLuna98/try_catch_loop.dart
[Dart] Try-catch in a while loop that retries a code after a specific duration time for a specific number of times
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;
@Adrek
Adrek / firebase.json
Created May 3, 2022 06:25 — forked from katowulf/firebase.json
Example of Firebase emulator unit tests and seed Firestore data
{
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"emulators": {
"firestore": {
"port": 8080
}
}
@Adrek
Adrek / Dockerfile
Created August 7, 2022 01:11 — forked from Klerith/Dockerfile
Preparar imagen de Docker - Node App
# 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
@Adrek
Adrek / password-property-dto.ts
Created August 20, 2022 15:50 — forked from Klerith/password-property-dto.ts
Password validation - DTO
@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;
@Adrek
Adrek / index.ts
Created October 15, 2022 21:28 — forked from Klerith/index.ts
Vuex + TypeScript - Store Structure Strongly Typed
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;