Skip to content

Instantly share code, notes, and snippets.

View riquellopes's full-sized avatar

Henrique Lopes riquellopes

View GitHub Profile
@riquellopes
riquellopes / docker-compose.yml
Created June 3, 2020 21:01
Simple docker compose file.
version: '2'
services:
example:
build: .
container_name: web-example
working_dir: /web_example
volumes:
- .:/web_example
command: sh -c "python manage.py runserver_plus 0.0.0.0:5000 --settings=web_example.settings.local"
expose:
@riquellopes
riquellopes / Dockerfile
Created June 3, 2020 20:17
Simple python3 container
FROM mio101/py3-mysqlclient-alpine
LABEL maintainer="Henrique Lopes"
ENV PYTHONUNBUFFERED 1
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN mkdir /app
WORKDIR /app
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 26 15:00:46 2020
@author: riquellopes
"""
import pandas as pd
import os
import http
import requests
from math import ceil
from lxml import html
from urllib.parse import urlparse
from requests.auth import HTTPBasicAuth
from fake_useragent import UserAgent
AURORA_ENERGY = 'https://easyview.auroravision.net/easyview/services/gmi/summary/PlantEnergy.json?eids={}'
dist: xenial
language: go
go:
- master
addons:
snaps: hugo
before_script:
- rm -rf public 2> /dev/null
--
SET @common_hash_secret=rand();
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE `addonlogs`;
TRUNCATE `api_auth_tokens`;
TRUNCATE `approvals`;
TRUNCATE `auth_group`;
TRUNCATE `auth_group_permissions`;
TRUNCATE `auth_message`;
# This is a sample anonymize.yml file that's used for the Firefox Add-ons
# database.
database:
truncate:
- addonlogs
- api_auth_tokens
- approvals
- auth_group
- auth_group_permissions
package main
import (
"context"
"log"
"net"
"github.com/riquellopes/vacations/go/protons"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
#! .venv/bin/python
# Simple client to connect a gRPC service to get information about the employee vacation.
import grpc
from protons.vacations_pb2 import VacationRequest
from protons.vacations_pb2_grpc import VacationServiceStub
def client():
with grpc.insecure_channel("localhost:50051") as dial:
client = VacationServiceStub(dial)
syntax = "proto2";
package protons;
service VacationService {
rpc WhenDoYouStartYourVacation(VacationRequest) returns (VacationResponse){}
}
message VacationRequest {
required string name = 1;