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

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>;
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!' });
}

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

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

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

@richellyitalo
richellyitalo / contentattributes.php
Created August 7, 2019 01:40 — forked from enderandpeter/contentattributes.php
Using PHP's SimpleXML class to find the attributes of a <media:content> element in an MRSS file.
<?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>