Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
/** | |
* @description Constituye un catálogo de errores de una API. | |
* Un catálogo es un mapa en donde se asocia un código de error | |
* con un mensaje describiendo el problema que se ha originado. | |
* Por ejemplo: | |
* { | |
* 24323: 'Ha ocurrido un error consumiendo el servicio externo ABC', | |
* 13424: 'No se encontraron coincidencias para la búsqueda' | |
* } | |
*/ |
type InterceptorResponse = Omit< | |
typeof Response.prototype, | |
'text' | 'formData' | 'blob' | 'json' | 'arrayBuffer' | |
> | |
type FetchInterceptorResponseConfig = { | |
onUnauthenticated?: (obj: InterceptorResponse) => void | |
onInternalError?: (obj: InterceptorResponse) => void | |
onForbidden?: (obj: InterceptorResponse) => void | |
onRateLimit?: (obj: InterceptorResponse) => void |
function unfollow() { | |
let count = 0 | |
const buttons = document.querySelectorAll('[data-testid*="-unfollow"]') | |
if (!buttons.length) { | |
console.log(`${count} People unfollowed`) | |
return | |
} | |
const waitFor = (ms) => new Promise(resolve => setTimeout(resolve, ms)) |
export function register() { | |
if ("serviceWorker" in navigator) { | |
return new Promise((resolve) => { | |
navigator.serviceWorker.register("/sw.js") | |
.then((registration) => { | |
registration.onupdatefound = () => { | |
const worker = registration.active; | |
if (worker == null) { | |
return; | |
} |
/** | |
* * This is not in use. | |
* * Para conocimiento general: | |
* Esta es una forma de generar el "precache manifest" | |
* de un service worker. La otra forma es como se detalla | |
* en el script de NPM "sw" en el presente package.json. | |
*/ | |
const workboxBuild = require("workbox-build"); | |
const buildServiceWorker = () => { |
{ | |
"to": "token o topic", | |
"priority": "high", | |
"notification": { | |
"title": "Title of the notification", | |
"body": "Description of the notification", | |
"android_channel_id": "Android channel" | |
}, | |
"data": { |
import 'package:flutter/material.dart'; | |
enum DialogButtonStyle { | |
PRIMARY, | |
SECONDARY, | |
} | |
void main() { | |
runApp(App()); | |
} |
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'); |