Skip to content

Instantly share code, notes, and snippets.

View maiquealmeida's full-sized avatar
🏠
Working from home

Maique Almeida maiquealmeida

🏠
Working from home
View GitHub Profile
@maiquealmeida
maiquealmeida / README.MD
Last active August 18, 2022 03:41
AdonisJS: How to get separated auth for admin and user models

How to get separated auth for admin and user models

Let's say you have 2 models. App/Models/User and App/Models/Admin Inside your config/auth.js, you can create multiple authenticators for admin and user.

{
  user: {
    serializer: 'lucid',
    model: 'App/Models/User',
 scheme: 'session',
@maiquealmeida
maiquealmeida / build.gladle
Created May 2, 2019 19:44
Após instalar o react-native-camera, ao compilar o projeto uma mensagem de erro passa ser exibida> Task :app:transformResourcesWithMergeJavaResForDebug FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. > More than one file was found with OS independent …
apply plugin: "com.android.application"
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
@maiquealmeida
maiquealmeida / index.js
Created April 18, 2019 20:49
Desativa a notificação sobre a extração do AsyncStorage do core do React-Native.
// Insira isto no index.js ou no App.js
import {YellowBox} from 'react-native';
YellowBox.ignoreWarnings(['Warning: Async Storage has been extracted from react-native core']); // <- insert the warning text here you wish to hide.
@maiquealmeida
maiquealmeida / App.js
Created April 18, 2019 20:03
Redux Store com Persist Gate (redux-persist), Reactotron Enhacer e Ducks Pattern.
import React from 'react';
import '~/config/reactotron';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';
import { store, persistor } from './store';
import Routes from '~/config/routes';
@maiquealmeida
maiquealmeida / settings.json
Created April 16, 2019 13:15
Snippet para VSCode: Personalização das cores da IDE (util quando você precisa lidar com multiplas instancias). Coloque dentro do diretorio .vscode do seu projeto.
{
"workbench.colorCustomizations": {
"titleBar.activeBackground": "#811519",
"titleBar.activeForeground": "#ffffff",
"titleBar.inactiveBackground": "#811519",
"titleBar.inactiveForeground": "#cccccc",
"sideBar.background": "#363636",
"activityBar.background": "#000",
"activityBar.foreground": "#00ff00",
"activityBar.border": "#ffffff",
@maiquealmeida
maiquealmeida / extensions.js
Last active May 26, 2019 16:19
Extensões para o VSCode que eu uso e recomento para React/React Native. (coloque o arquivo no diretorio .vscode do seu projeto)
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"dzannotti.vscode-babel-coloring",
"naumovs.color-highlight",
"anseki.vscode-color",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"rocketseat.rocketseatreactnative",
@maiquealmeida
maiquealmeida / README.ME
Created March 20, 2019 15:55
CRA & Typescript
# React & Typescript
## Iniciando um novo projeto
https://facebook.github.io/create-react-app/docs/adding-typescript
## Migrando um projeto existente
https://vincenttunru.com/migrate-create-react-app-typescript-to-create-react-app/
@maiquealmeida
maiquealmeida / CmderZSH.md
Created March 20, 2019 04:25 — forked from dfontana/CmderZSH.md
My setup guide for installing Cgywin, Mintty, Cmder, and ZSH.

What's this?

Instructions to obtain ZSH on a windows environment, without the input funny business presented by some other attempted solutions.

The final result is ZSH running on a mintty terminal, emulated by cygwin, and being handled by the popular cmder.

Why is this here?

For the benefit of myself and others. I've already followed these instructions twice. It took me hours to figure all this out, maybe someone else can save a few.

What exactly is covered?

  • Installing and setting up cmder
@maiquealmeida
maiquealmeida / App.js
Created March 19, 2019 21:26
Utilizando GlobalStyles com styled-components
import React, { Component, Fragment } from 'react';
import GlobalStyle from './styles/GlobalStyles';
import Routes from './routes';
class App extends Component {
state = {};
render() {
return (
<Fragment>
@maiquealmeida
maiquealmeida / .editorconfig
Last active March 5, 2019 15:56
Configuração do ESLint e EditorConfig para uso com o CRA
root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true