Skip to content

Instantly share code, notes, and snippets.

View JoseLion's full-sized avatar
🦁
Eat, Sleep, Code, Workout, Repeat.

Jose Luis Leon JoseLion

🦁
Eat, Sleep, Code, Workout, Repeat.
View GitHub Profile
@JoseLion
JoseLion / asyncStorageMock.ts
Created March 31, 2020 15:06
Basic mock for "@react-native-community/async-storage-backend-legacy"
import { EmptyStorageModel, IStorageBackend, StorageOptions } from "@react-native-community/async-storage";
export default class MockAsyncStorage<T = EmptyStorageModel> implements IStorageBackend<T> {
private MOCK_STORAGE: T = {} as T;
public async getSingle<K extends keyof T>(key: K, opts?: StorageOptions): Promise<T[K] | null> {
const obj = await this.getMany<K>([key], opts);
return obj[key] ?? null;
}
@JoseLion
JoseLion / eslintrc.config.js
Last active June 19, 2024 03:38
ESLint v9 Config
// @ts-check
import { fixupPluginRules } from "@eslint/compat";
import { FlatCompat } from "@eslint/eslintrc";
import eslintJs from "@eslint/js";
import stylistic from "@stylistic/eslint-plugin";
import etc from "eslint-plugin-etc";
import jsdoc from "eslint-plugin-jsdoc";
import reactJsxRuntime from "eslint-plugin-react/configs/jsx-runtime.js";
import reactRecommended from "eslint-plugin-react/configs/recommended.js";
import sonarjs from "eslint-plugin-sonarjs";
@JoseLion
JoseLion / build.gradle
Created March 23, 2024 04:20
Spring Boot | WebFlux + WebSocket
dependencies {
implementation(libs.spring.webflux)
implementation(libs.spring.websocket) {
exclude(group: 'org.springframework.boot', module: 'spring-boot-starter-web')
}
}