Skip to content

Instantly share code, notes, and snippets.

View CarlosChiarelli's full-sized avatar
🏠
Working from home

Carlos Chiarelli CarlosChiarelli

🏠
Working from home
View GitHub Profile
const handleAddGeolocation = async () => {
if (isFetchingLocation) return; // evita múltiplos cliques
setIsFetchingLocation(true);
try {
// 1) Verifica se os serviços de localização estão ativos
const servicesEnabled = await Location.hasServicesEnabledAsync();
if (!servicesEnabled) {
Alert.alert(
'Serviço de localização desligado',
version: '3.1'
services:
mongo:
image: mongo
container_name: "mongo"
restart: always
environment:
@CarlosChiarelli
CarlosChiarelli / settings.json
Last active August 15, 2021 22:46
config-python-vscode
{
"editor.fontFamily": "'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
"workbench.startupEditor": "newUntitledFile",
"editor.minimap.enabled": true,
"editor.fontSize": 13,
"code-runner.clearPreviousOutput": true,
"breadcrumbs.enabled": true,
"workbench.iconTheme": "material-icon-theme",
"window.zoomLevel": 1,
"debug.console.fontSize": 13,
@CarlosChiarelli
CarlosChiarelli / main.py
Last active July 28, 2021 16:38
Schedule python (2 process)
"""
# Dockerfile
FROM python:3.7.9-slim-buster
WORKDIR /app
COPY requirements.txt requirements.txt
RUN python -m pip install -r requirements.txt
@CarlosChiarelli
CarlosChiarelli / model-field-json-unique.py
Last active May 12, 2021 13:52
Modelo "Compras" com campo JSON único (SQLAlchemy Python)
from app.data import db # db = SQLAlchemy()
from sqlalchemy.dialects.postgresql import JSON
import json
import hashlib
class ComprasRaw(db.Model):
__tablename__ = "compras_raw"
__table_args__ = (db.UniqueConstraint("values", "hash_values"),)
@CarlosChiarelli
CarlosChiarelli / Install
Created July 21, 2020 17:02 — forked from ines/Install
Streamlit + spaCy
pip install streamlit
pip install spacy
python -m spacy download en_core_web_sm
python -m spacy download en_core_web_md
python -m spacy download de_core_news_sm