Skip to content

Instantly share code, notes, and snippets.

View yuritoledo's full-sized avatar
🌌

Yuri Toledo yuritoledo

🌌
View GitHub Profile
@rdeavila
rdeavila / git-update-fork.sh
Last active March 10, 2025 23:52
Git: como atualizar um fork com as mudanças do original?
#!/bin/bash
# Adicione um novo remote; pode chamá-lo de "upstream":
git remote add upstream https://github.com/usuario/projeto.git
# Obtenha todos os branches deste novo remote,
# como o upstream/master por exemplo:
git fetch upstream
@lopspower
lopspower / README.md
Last active May 16, 2025 20:12
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@csarron
csarron / scrcpy_shortcut.md
Created April 20, 2018 02:08
Scrcpy Shortcuts

Scrcpy Shortcuts

Action Shortcut
switch fullscreen mode Ctrl+f
resize window to 1:1 (pixel-perfect) Ctrl+g
resize window to remove black borders Ctrl+x | Double-click¹
click on HOME Ctrl+h | Middle-click
click on BACK Ctrl+b | Right-click²
click on APP_SWITCH Ctrl+m
@yuritoledo
yuritoledo / .eslintrc
Last active June 8, 2019 19:04
react eslint rules
{
"linebreak-style": [
"warn",
"unix"
],
"no-multiple-empty-lines": [
"warn",
{
"max": 2,
"maxEOF": 1
@rafaelreuber
rafaelreuber / boleto.py
Created April 23, 2019 03:19
Geração de boleto usando python-boleto
def gerar_itau(fatura, bank, encargos=0):
invoice = BoletoItau()
invoice.data_vencimento = fatura.dtvencto.date()
invoice.data_documento = fatura.dtemissao
invoice.nosso_numero = fatura.nosso_numero
invoice.numero_documento = fatura.fatura
invoice.valor_documento = fatura.valor
empresa = Empresa.objects.get(pk=settings.STUR_EMPRESA)
export function cpfMask (value) {
return value
.replace(/\D/g, '')
.replace(/(\d{3})(\d)/, '$1.$2')
.replace(/(\d{3})(\d)/, '$1.$2')
.replace(/(\d{3})(\d{1,2})/, '$1-$2')
.replace(/(-\d{2})\d+?$/, '$1')
}
export function cnpjMask (value) {
{
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaFeatures": {
@yuritoledo
yuritoledo / .rotate-image64.js
Created August 13, 2019 20:12
Rotate image and get new base64
const convert = (src, goToRight) => {
const img = new Image()
const canvas = document.createElement('canvas')
const ctx = canvas.getContext('2d')
img.crossOrigin = 'Anonymous'
img.onload = () => {
canvas.width = img.width
canvas.height = img.height
goToRight
? ctx.transform(0, -1, 1, 0, 0, img.height)
@yuritoledo
yuritoledo / eslint.json
Created October 9, 2019 15:16
eslint react para typescript
{
"env": {
"browser": true,
"es6": true,
"jest": true
},
"settings": {
"react": {
"version": "detect"
}
@yuritoledo
yuritoledo / gist:f6dadb8deacf898d168c07f239e105cf
Created October 14, 2019 23:52
Remover acentos javascript es6
const removeAcentos = str => str.normalize('NFD').replace(/[\u0300-\u036f]/g, "")