Skip to content

Instantly share code, notes, and snippets.

View richellyitalo's full-sized avatar
🏹
Exploring RemixJs

Richelly Italo richellyitalo

🏹
Exploring RemixJs
View GitHub Profile
import { promisify } from 'util';
import jwt from 'jsonwebtoken';
import authConfig from '../../config/auth';
export default async (req, res, next) => {
const authHeader = req.headers.authorization;
if (!authHeader) {
return res.status(401).json({ error: 'Não autenticado!' });
}

1 - Format

string_in_string = "Shepherd {} is on duty.".format(shepherd)
print(string_in_string)
# saída = Shepherd Mary is on duty.

1.1 - Brackets

Pegar último registro

# Maneira 1
last_banner = Banner.objects.order_by('-pk')[:1]
if last_banner.exists():
    instance['sort_order'] = last_banner[0].sort_order + 1
    
# Maneira 2
# Pode gerar erro caso não exista registro
import React, { Component } from 'react';
import { render } from 'react-dom';
export default class App extends Component {
constructor(props) {
super(props);
}
render() {
return <h1>Richelly Italo</h1>;

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

Instalação dos pacotes

yarn add eslint-config-airbnb eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react -D

".eslintrc" na raiz do projeto

{
  "env": {
    "browser": true,
    "jest": true,
 "es6": true

Criação de alias

git config --global alias.assume-unchanged 'update-index --assume-unchanged'

Adicionar ou remover arquivos à área de mudanças do projeto

Pode ser utilizado "pasta/*" para todos os arquivos da pasta

adiciona = git update-index --assume-unchanged <file>
remove = git update-index --no-assume-unchanged <file>

@richellyitalo
richellyitalo / keybindings.json
Last active October 22, 2019 13:40 — forked from 3v1n0/keybindings.json
VSCode keybindings for alternative HJLK navigation, when using non-vim mode and support for quick panel navigation with Tab/Shift+Tab.
/* VSCode keybindings for alternative HJLK navigation, when using non-vim mode
* and support for quick panel navigation with Tab/Shift+Tab.
*
* So basically I just tried to use everywhere in the editor these aliases:
* Alt+j = down
* Alt+k = up
* Alt+l = right
* Alt+h = left
* Alt+b = previous-word
* Alt+w = next-word