Skip to content

Instantly share code, notes, and snippets.

View kinxori's full-sized avatar
💭
open to work 📫

Gustavo Quiroz kinxori

💭
open to work 📫
View GitHub Profile
@kinxori
kinxori / Email Form With Google Recaptcha.jsx
Last active February 8, 2024 07:14
Next.js ReCaptcha Email Form Component with Google site verification using axios.
// Get your registration at https://www.google.com/recaptcha/about/ to get your "sitekey" and your "secret" (required‼️).
// Install react-google-recaptcha library
// ~npm i react-google-recaptcha / ~ yarn add react-google-recaptcha
"use client";
import { useState, useRef } from "react";
import { verifyCaptcha } from "./ReCaptchaVerify";
import ReCAPTCHA from "react-google-recaptcha";
export const EmailForm = () => {
@kinxori
kinxori / Copy text to clipboard - React
Last active July 6, 2023 20:06
React component to copy an specific text to device's clipboard. Using "navigator.clipboard" and adding visual feedback after 5 seconds of copied.
export default function ContactPage() {
const [clipboardIsCopy, setClipboardIsCopy] = useState(false);
const textToClipBoard = useRef("");
const handleClipboardState = () => {
const text = textToClipBoard.current.?textContent;
navigator.clipboard.writeText(text);
setClipboardIsCopy(!clipboardIsCopy);
setTimeout(() => {
@kinxori
kinxori / Random Emoji Generator using React.jsx
Last active May 14, 2023 08:33
Create Random Emoji Generator function. We are using React and fetching from "emoji-api.com". (updates every time your father component has a movement, not fixed yet 🥲)
import { useEffect, useState } from "react"; // Import your React hooks
const [emojiData, setEmojiData] = useState([]); // State variable to store the emoji data
const EmojiAPI = "https://emoji-api.com/emojis?access_key=👺Register to the page and generate your unique key👺"
//👺Atention here
useEffect(() => { // We use useEffect hook to fetch our API everytime our page loads
const fetchEmojiData = async () => {
const response = await fetch(EmojiAPI)
@kinxori
kinxori / Firebase Mailer Function.js
Last active May 14, 2023 08:33
Sending emails via Gmail using React.js and Firebase Functions. (Ignore the typescript)👺
const functions = require("firebase-functions");
const nodemailer = require("nodemailer");
const dotenv = require("dotenv"); // enable enviorment variables
dotenv.config();
const transport = nodemailer.createTransport({ // This is what is going to send your email
service: "Gmail", // We are using gmail here
auth: {
user: "user@example.com", //use your enviorment variables here