Skip to content

Instantly share code, notes, and snippets.

Avatar
🏹
Exploring Flutter

Richelly Italo richellyitalo

🏹
Exploring Flutter
View GitHub Profile
View maneiras-formatar-string.md

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

View queryies.md

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
View App.js
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>;
View authMiddleware.js
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!' });
}
View semantic-commit-messages.md

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

View comandos-uteis-git.md

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 Oct 22, 2019 — 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.
View keybindings.json
/* 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
View swal-com-html.md

swal({ title: '', content: { element: "div", attributes: { innerHTML: res.mensagem }, }, icon: "success" })

@richellyitalo
richellyitalo / contentattributes.php
Created Aug 7, 2019 — forked from enderandpeter/contentattributes.php
Using PHP's SimpleXML class to find the attributes of a <media:content> element in an MRSS file.
View contentattributes.php
<?php
$mrss =<<<EOS
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/"
xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">
<channel>
<title>My Movie Review Site</title>
<link>http://www.foo.com</link>
<description>I review movies.</description>