Skip to content

Instantly share code, notes, and snippets.

View ricardoleme's full-sized avatar

Prof. Ms. Ricardo Leme ricardoleme

View GitHub Profile
@ricardoleme
ricardoleme / txt
Created October 19, 2021 21:47
Inicializando um novo projeto ReactJS com Bootstrap
# Adicionando o Yarn
npm install --global yarn
# Criando um novo aplicativo via create-react-app
npx create-react-app seu-app
cd seu-app
# Instalando o Bootstrap e o React Icons
npm install react-bootstrap bootstrap react-icons
# Inicializando o VsCode
code .
# Acesse o Menu Terminal/New Terminal
@ricardoleme
ricardoleme / .js
Created March 22, 2022 00:27
Conexao ao MongoDB
import mongodb from 'mongodb'
const { MongoClient, ObjectId } = mongodb
import { config } from 'dotenv'
config() // carrega as variáveis definidas no .env
const { MONGODB_URI, MONGODB_DB } = process.env
if (!MONGODB_URI) {
throw new Error(
import React, { useState } from 'react'
import styled from 'styled-components/native'
import { MaterialCommunityIcons } from '@expo/vector-icons'
import themes from '../../themes'
const InputArea = styled.View`
width: 100%;
height: 64px;
background-color: ${props => props.theme.card};
flex-direction: row;
@ricardoleme
ricardoleme / mongodb.js
Created October 18, 2022 00:04
Exemplo de Conexao ao MongodB
import mongodb from 'mongodb'
const { MongoClient, ObjectId } = mongodb
import { config } from 'dotenv'
config() // carrega as variáveis definidas no .env
const { MONGODB_URI, MONGODB_DB } = process.env
if (!MONGODB_URI) {
throw new Error(
@ricardoleme
ricardoleme / gerando-apk.md
Created April 26, 2023 13:06
Gerando APK local com o novo EAS do Expo

Para gerar um APK local com o novo EAS do Expo:

  1. Instale o eas-cli de forma Global via npm (o Expo não recomenda o uso do Yarn para pacotes globais😪)
npm install -g eas-cli
  1. Faça o login na sua conta Expo
eas login
@ricardoleme
ricardoleme / index.html
Created August 23, 2023 14:21
Como converter uma DIV em imagem PNG
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Download Div as PNG</title>
<!--
Importe o DOMtoImage
É uma biblioteca JavaScript que permite capturar e converter elementos DOM (Document Object Model) em imagens.
-->
@ricardoleme
ricardoleme / mongodb.js
Created September 4, 2023 15:01
Conexao ao MongoDB
import mongodb from 'mongodb'
const { MongoClient, ObjectId } = mongodb
import { config } from 'dotenv'
config() // carrega as variáveis definidas no .env
const { MONGODB_URI, MONGODB_DB } = process.env
if (!MONGODB_URI) {
throw new Error(
@ricardoleme
ricardoleme / instrucoes.txt
Created November 8, 2023 23:57
Set up CORS for Google Cloud Storage Bucket
#Para listar o Bucket name:
gsutil ls
#Definindo as regras de acesso
echo '[{"origin": ["*"],"responseHeader": ["Content-Type"],"method": ["GET", "HEAD"],"maxAgeSeconds": 3600}]' > cors-config.json
#Setando as configurações no Bucket
gsutil cors set cors-config.json gs://YOUR_BUCKET_NAME
#Visualizando as configurações