Skip to content

Instantly share code, notes, and snippets.

View robsonkades's full-sized avatar
🎯
Focusing

Robson Kades robsonkades

🎯
Focusing
View GitHub Profile
@robsonkades
robsonkades / Image.tsx
Created September 14, 2021 00:48
Integrate NextJs `next/image` with Chakra-UI styling
import { chakra, ThemingProps, useStyleConfig } from '@chakra-ui/react'
import NextImage, { ImageProps as NextImageProps } from 'next/image'
import { ReactElement } from 'react'
import { Sizes } from '../../theme/variables/image'
// TODO review props when NextJs is updated so we don't have to defined it here
/**
* ? Because NextJs typing is preventing auto-suggest for layout, width and height,
* ? we declare the styles differently in this component and will manage the switch
* ? to NextJs typings when calling NextJs `next/image` component
package com.robsonkades.platform.authorization.cache;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentSkipListSet;
import java.util.concurrent.ExecutorService;
import { AppProps } from 'next/app';
import { RecoilRoot } from 'recoil';
export function withRecoil<T extends AppProps = AppProps>(
WrappedComponent: React.ComponentType<T>
) {
const displayName =
WrappedComponent.displayName || WrappedComponent.name || 'Component';
const Component = (props: Omit<T, keyof AppProps>) => {
package br.com.kades.robson.configuration;
import static org.apache.commons.collections4.CollectionUtils.emptyIfNull;
import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
import java.util.Arrays;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
package br.com.kades.robson.configuration;
import java.util.HashSet;
import java.util.Set;
import org.modelmapper.ModelMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import lombok.AccessLevel;
import Ws from '@adonisjs/websocket-client';
import { toast } from 'react-toastify';
import { eventChannel } from 'redux-saga';
import { all, takeLatest, call, take, put, select } from 'redux-saga/effects';
import { history } from '../../../services';
import {
subscribeUserRequest,
subscribeChatRequest,
subscribeChatSuccess,
@robsonkades
robsonkades / metatags.html
Created December 10, 2020 17:58 — forked from diego3g/metatags.html
Meta tags do curso de Next.js
<meta httpEquiv="x-ua-compatible" content="IE=edge,chrome=1" />
<meta name="MobileOptimized" content="320" />
<meta name="HandheldFriendly" content="True" />
<meta name="theme-color" content="#121214" />
<meta name="msapplication-TileColor" content="#121214" />
<meta name="referrer" content="no-referrer-when-downgrade" />
<meta name="google" content="notranslate" />
<meta property="og:title" content={pageTitle} />
<meta property="og:description" content={description} />
Source address:
</^[^.]+$|\.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf|map)$)([^.]+$)/>
Target address:
/index.html
Type:
200 (Rewrite)
import firebase from 'firebase';
import produce from 'immer';
import { useEffect, useReducer, useRef, useCallback } from 'react';
type IAction<K, V = void> = V extends void ? { type: K } : { type: K } & V;
export type IActionType =
| IAction<'LOAD_REQUEST'>
| IAction<
'LOAD_SUCCESS',
@robsonkades
robsonkades / settings.json
Created May 25, 2020 19:41 — forked from diego3g/settings.json
✏️ Minha config do VSCode atualizada
{
"terminal.integrated.fontSize": 14,
"workbench.iconTheme": "material-icon-theme",
"workbench.startupEditor": "newUntitledFile",
"editor.tabSize": 2,
"editor.fontSize": 18,
"editor.lineHeight": 26,
"editor.fontFamily": "Fira Code",