Skip to content

Instantly share code, notes, and snippets.

@AngelKrak
AngelKrak / getImageWeserv.js
Created February 14, 2024 19:41
getImage by Weserv
const imageUrl = (url, opts) =>
`https://wsrv.nl/?${new URLSearchParams({
/* The image URL to optimize */
url,
/* In case something goes wrong, just show the image */
default: url,
/*
@AngelKrak
AngelKrak / comandos-docker.md
Last active January 13, 2023 15:45
Comandos para Docker y Docker-Compose

No olvides reemplazar los <id_name> de los comandos por el tuyo

Actualizar nuevos cambios en el container.

sudo docker-compose up -d --build

Otra opción:

sudo docker-compose build && docker-compose up --renew-anon-volumes -d

Ver todos los contenedores corriendo.

docker ps

@AngelKrak
AngelKrak / MergeNativeLibsTask-mergeDebugNativeLibs-react-native.md
Created November 11, 2022 04:57
error: cannot find symbol UIImplementationProvider - react-native-reanimated

Errors:

  • :react-native-reanimated:compileReleaseJavaWithJavac FAILED
  • cannot find symbol - class ReaUiImplementationProvider extends UIImplementationProvider
  • constructor UIManagerModule.UIManagerModule(ReactApplicationContext,ViewManagerResolver,int) is not applicable

Description:

  Task :react-native-reanimated:compileReleaseJavaWithJavac FAILED
  /node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java:15: error: cannot find symbol
class ReaUiImplementationProvider extends UIImplementationProvider {
@AngelKrak
AngelKrak / version-kotlin-incompatible-react-native.md
Created November 11, 2022 04:57
Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.0.

Errors:

  • Detected multiple Kotlin daemon sessions at build/kotlin/sessions
  • was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.0.
  • Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.0.

Tasks:

  • Execution failed for task ':react-native-screens:compileDebugKotlin'.

Instrucciones:

@AngelKrak
AngelKrak / MergeNativeLibsTask-mergeDebugNativeLibs-react-native.md
Created November 11, 2022 04:56
2 files found with path 'lib/arm64-v8a/libc++_shared.so' from inputs: - If you are using jniLibs and CMake IMPORTED targets, see

Errors:

Description:

  2 files found with path 'lib/arm64-v8a/libc++_shared.so' from inputs:
  - /Users/username/.gradle/caches/transforms-3/867141dd00dd9221e01e5c82748f2a99/transformed/jetified-react-native-0.71.0-rc.0-debug/jni/arm64-v8a/libc++_shared.so
 - /Users/username/.gradle/caches/transforms-3/402164579eac94d3279c98f4a43eb5d8/transformed/jetified-fbjni-0.3.0/jni/arm64-v8a/libc++_shared.so
@AngelKrak
AngelKrak / flatlist.js
Created July 26, 2022 16:16 — forked from victorwpbastos/flatlist.js
Better performance paginated FlatList
import React, { useState, useEffect } from 'react';
import { Text, FlatList, View, TextInput, TouchableOpacity } from 'react-native';
let arr: any[] = [];
for (let i = 1; i <= 100; i++) {
arr.push({ id: i, text: `mensagem bacana #${i}` });
}
arr.reverse();
@AngelKrak
AngelKrak / create index.android.bundle
Created July 4, 2022 17:16
Unable to load script. Make sure you're either running a Metro server (run 'react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release
mkdir android/app/src/main/assets
npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
cd android && ./gradlew clean && cd ../
(Optional)
adb reverse tcp:8081 tcp:8081
@AngelKrak
AngelKrak / solucionar_problema_simulador_no_abre.md
Created July 1, 2022 15:22
Unable to boot the simulator launchd failed to respond - Solución
sudo chmod 1777 /Volumes/Macintosh\ HD/private/tmp
sudo chown root:admin /tmp; sudo chmod 1777 /tmp
sudo chown root:wheel /private/tmp; sudo chmod 1777 /private/tmp
xcrun simctl shutdown all

Eliminar todos los datos de tu proyecto compilado.

Go to Xcode -> Preferences -> Locations -> Derived Data (Click the little arrow) -> Delete the folder for your project.

@AngelKrak
AngelKrak / CountryCodes.json
Created June 21, 2022 20:25 — forked from anubhavshrimal/CountryCodes.json
Country and Dial or Phone codes in JSON format
[
{
"name": "Afghanistan",
"dial_code": "+93",
"code": "AF"
},
{
"name": "Aland Islands",
"dial_code": "+358",
"code": "AX"
@AngelKrak
AngelKrak / instalar-sitio-web-en-2-partes-con-duplicator.md
Created February 11, 2022 00:13
Instalar sitio web en 2 partes con [Duplicator]

Instalar sitio web en 2 partes con [Duplicator]

Parte 1: Copiar manualmente los archivos de WordPress

  1. Seleccione todos los archivos, haga clic con el botón derecho, seleccione "Comprimir", elija zip y ponga como nombre mysite.zip.
  2. Descargue mysite.zip en su ordenador local
  3. Sube mysite.zip a la nueva ubicación*.
  4. Extraiga mysite.zip y elimine el archivo mysite.zip

Parte 2: Copiar la base de datos con Duplicator

  1. Transferir el instalador y el archivo a la ubicación de destino
  2. Si existe un archivo wp-config.php en esta ubicación eliminar o renombrar.