No requires Android Studio 🥳
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
enum DialogButtonStyle { | |
PRIMARY, | |
SECONDARY, | |
} | |
void main() { | |
runApp(App()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math'; | |
void main() async { | |
var pwd = await getRandomPwd(8); | |
print(pwd); | |
} | |
Future<String> getRandomPwd(int length) async { | |
if (length > 62) { | |
throw Error('The max length of the password could be 62'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Courtesy of https://stackoverflow.com/a/61929967/10670707 | |
Future<String> genRandomAlphanumeric(int length) async { | |
const _chars = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890'; | |
Random _rnd = Random(); | |
return String.fromCharCodes( | |
Iterable.generate( | |
length, | |
(_) => _chars.codeUnitAt(_rnd.nextInt(_chars.length)) | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const withPWA = require('next-pwa') | |
module.exports = withPWA({ | |
pwa: { | |
dest: 'public' | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Environment { | |
static string(varName: string, defaultValue = ""): string { | |
const value = process.env[`REACT_APP_${varName}`]; | |
return value ?? defaultValue; | |
} | |
static int(varName: string, defaultValue = 0): number { | |
const value = process.env[`REACT_APP_${varName}`]; | |
if (value) { | |
return Number.parseInt(value, 10); |
Instalar Sonarlint
Lo primero es instalar la extensión Sonarlint en nuestro Code.
Crear un token
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface User { | |
name: string; | |
age: number; | |
birthDate: Date; | |
admin: boolean; | |
foo?: { | |
bar: string; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
const JitsiMeet = () => { | |
const [jitsi, setJitsi] = useState<JitsiInstance | null>(null); | |
return null; | |
} |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent