Skip to content

Instantly share code, notes, and snippets.

@augustogoulart
augustogoulart / pull_request_template.md
Created September 6, 2024 21:30
Pull reques template

Description

Fixes # (issue link)

Are there any extra information you want to provide which is not covered by the issue?

Customer Impact

What customer facing areas could this change cause regressions for?

"""
Cheque por Extenso
Apesar de o volume de cheques emitidos ter diminuído drásticamente nos últimos anos, principalmente devido a
popularização dos cartões de crédito e débito, eles ainda são utilizados em muitas compras, especialmente as de valor
alto. E para auxiliar no seu preenchimento, vários estabelecimentos possuem máquinas que dado o valor da compra,
preenchem o cheque com o seu valor por extenso.
Desenvolva um programa que dado um valor monetário, seja retornado o valor em reais por extenso.
#!/bin/bash
#sleep 999999
set -e
host="$1"
shift
cmd="$@"
until PGPASSWORD=$POSTGRES_PASSWORD psql -h "$host" -U "postgres" -c '\q'; do
>&2 echo "Postgres is unavailable - sleeping"
<template>
<nuxt-link class="post-preview" :to="postLink">
<article>
<div class="post-thumbnail"
:style="{backgroundImage: `url(${thumbnail})`}"></div>
<div class="post-content">
<h1>{{ title }}</h1>
<p>{{ previewText }}</p>
</div>
</article>
import emoji as em
import os
def break_line(symbol, emoji=False):
"""
Try using emojis to make your debugging experience less miserable.
Go check the emoji cheat sheet: https://www.webpagefx.com/tools/emoji-cheat-sheet
"""
_, columns = os.popen('stty size', 'r').read().split()
@augustogoulart
augustogoulart / git-pull-all
Created March 8, 2018 13:17 — forked from grimzy/git-pull-all
Git pull all remote branches
#!/usr/bin/env bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@augustogoulart
augustogoulart / webpack.config.js
Last active November 21, 2017 21:51
Simple webpack config
const webpack = require('webpack');
module.exports = {
entry: {
filename: './app.js',
},
output: {
filename: './build.js',
},
def show_request_data(request):
values = request.META.items()
html = []
for k, v in values:
html.append('<tr><td>%s</td><td>%s</td></tr>' % (k, v))
return HttpResponse('<table>%s</table>' % '\n'.join(html))
@augustogoulart
augustogoulart / pillow_profiles.py
Created August 3, 2017 01:56
Simple profiler to understand Pillow memory usage working with images in memory.
from urllib.request import urlopen
from PIL import Image
from memory_profiler import profile
@profile
def run():
img = Image.open(urlopen("https://graviolastatics.s3.amazonaws.com/thumbnails/card.jpg"))
thumbnail = img.resize((300, 300), Image.ANTIALIAS)
thumbnail.show()