Skip to content

Instantly share code, notes, and snippets.

View jonathanpalma's full-sized avatar
🐶
Fetching Bytes

Jonathan Palma jonathanpalma

🐶
Fetching Bytes
View GitHub Profile
@jonathanpalma
jonathanpalma / useYupValidationResolver.ts
Last active March 7, 2023 16:36
Type-safe react hook to use yup validation resolver with react-hook-form
import { useCallback } from 'react';
import { object, ValidationError } from 'yup';
const useYupValidationResolver = (
validationSchema: ReturnType<typeof object>
) =>
useCallback(
async (data) => {
try {
const values = await validationSchema.validate(data, {
@jonathanpalma
jonathanpalma / dock.theme
Created September 22, 2020 03:57
Elementary OS plank theme
[PlankTheme]
#The roundness of the top corners.
TopRoundness=4
#The roundness of the bottom corners.
BottomRoundness=0
#The thickness (in pixels) of lines drawn.
LineWidth=0
#The color (RGBA) of the outer stroke.
OuterStrokeColor=72;;72;;72;;120
#The starting color (RGBA) of the fill gradient.
@jonathanpalma
jonathanpalma / KeychainStorage.js
Last active July 11, 2023 10:28
How to persis redux store using redux-persist and react-native-keychain
import AsyncStorage from '@react-native-community/async-storage';
import {
setGenericPassword,
getGenericPassword,
resetGenericPassword,
} from 'react-native-keychain';
const KeychainStorage = {
async getAllKeys(cb) {
try {