Skip to content

Instantly share code, notes, and snippets.

openapi: 3.1.0
info:
title: Recruitment Form
description: |-
Let's create a restful API for the previous ReactJS Project
Some useful links:
- [Base repo](https://github.com/swagger-api/swagger-petstore)
version: 0.0.1
servers:
[
{
"title": "100",
"symbol": "💯",
"keywords":
"hundred points symbol symbol wow wow win win perfect perfect parties parties"
},
{
"title": "1234",
"symbol": "🔢",
@carmandomx
carmandomx / data.json
Created April 14, 2022 18:02
Data for problem #1 - PSET5
[
{
"title": "Work",
"timeframes": {
"daily": {
"current": 5,
"previous": 7
},
"weekly": {
"current": 32,
import './App.css'
import { useForm } from 'react-hook-form'
import axios from 'axios'
import { useEffect, useState } from 'react'
function App () {
const { register, handleSubmit } = useForm()
const [postData, setPostData] = useState(null)
useEffect(() => {
{
"id": "60a7e470ec97c8ab71694248",
"task": "Acabar este Entregable",
"student": "Jovan",
"isCompleted": false,
"version": 0
}
const fib = (pos, memos) => {
if (pos === 0) {
return 0
}
if (pos === 1) {
return 1
}
if (memos[pos] !== undefined) {
@carmandomx
carmandomx / gist:ef864d04ecd5234e7ac3f382a83b44e4
Created February 16, 2021 02:08
Sencillo ejemplo de un formulario c/ RHF
import { useForm } from "react-hook-form";
const Login = () => {
const { register, handleSubmit } = useForm();
const onSubmit = (data) => {
console.log(data);
};
return (
import { useEffect, useState } from "react";
import "./App.css";
const Search = ({ handleSearchTerm }) => {
const [searchTerm, setSearchTerm] = useState("");
return (
<div>
<input
onChange={(e) => {
const value = e.target.value;
@carmandomx
carmandomx / gist:6d2aebfeee2a58237d19c9abbe465961
Created February 5, 2021 02:26
Ejemplo simple de como llamar un API en React
import "./App.css";
import React, { useState, useEffect } from "react";
const getQuotesFromGit = () => {
const res = fetch(
"https://gist.githubusercontent.com/carmandomx/3d7ac5f15af87a587e1d25f5ba96de61/raw/e2d848b87c730a580077de221666343c15b1a243/gistfile1.txt",
{ mode: "cors" }
);
return res.then((value) => value.json());
};
@carmandomx
carmandomx / gist:9bb6cc86d76ba85e7d23685e598687ad
Created February 4, 2021 03:45
Clase: Eventos - Ejercicio Formulario
import "./App.css";
import React, { useState } from "react";
function App() {
const [color, setColor] = useState("#e97878");
const [user, setUser] = useState("");
const [passwd, setPasswd] = useState("");
const [isSubmitted, setIsSubmitted] = useState(false);