Skip to content

Instantly share code, notes, and snippets.

View huogerac's full-sized avatar
:octocat:

Roger Camargo huogerac

:octocat:
View GitHub Profile
@huogerac
huogerac / models.py
Created March 13, 2024 23:23
carrinho de compra no Django
from django.db import models
from django.urls import reverse
from django.contrib.auth import get_user_model
class Categoria(models.Model):
nome = models.CharField(max_length=32)
class Produto(models.Model):
@huogerac
huogerac / main.tf
Created August 18, 2023 19:18
terraform_gcp_postgres
resource "random_integer" "postgres_port" {
min = 5432
max = 5432
}
resource "google_sql_database_instance" "postgres" {
name = "${var.environment}-postgres"
database_version = var.engine_version
deletion_protection = var.deletion_protection
"""
14 <-- \o/
7
T
"""
<template>
<h1>Listar Pokemon</h1>
<ul>
<li v-for="pokemon of listaPokemon" :key="pokemon.id">
<p>
{{ pokemon.name }}
<span><button @click="obterDetalhes(pokemon)">detalhes</button></span>
</p>
<div v-if="pokemon.detalhe">
<p>{{ pokemon.detalhe.base_experience }} <img :src="pokemon.detalhe.image" alt="" /></p>
def cep_json_xml(cep, formato):
cepEntrada = cep
tipoCep =""
cepTemp =""
metodo ="buscarCep"
formato = formato.lower()
url = 'http://m.correios.com.br/movel/buscaCepConfirma.do'
post_data_dictionary = {'cepEntrada': cepEntrada, 'tipoCep': tipoCep, 'cepTemp': cepTemp, 'metodo':metodo}
"""
Celery Tasks
============
This file defines the expected API.
"""
import jsonschema
from celery import Celery, subtask, group, chord
from . import settings
@huogerac
huogerac / HomeView.vue
Created June 7, 2018 03:34
Push Notifications
<template>
<div>
<!-- componente que encapsula o PUSH NOTIFICATION -->
<push-notification
ref="pushNotification"
:currentToken="userToken"
@update-token="onUpdateToken"
@new-message="onNewMessage" />
#!/bin/bash
# This script is based on
# https://medium.com/welcome-to-the-django/guia-definitivo-para-organizar-meu-ambiente-python-a16e2479b753
PYTHON2_VERSION='2.7.12'
PYTHON3_VERSION='3.5.2'
sudo apt-get install -y git python-pip make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev
sudo pip install virtualenvwrapper
@huogerac
huogerac / redis.sh
Created March 3, 2018 21:17
ascii-art-block
_._
_.-`` ''-._
_.-`` O ''-._
.-`` ''-._
( O )
|`-._ _.-'|
| `-._ _.-' |
`-._ `-._ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.