Skip to content

Instantly share code, notes, and snippets.

View HectorBlisS's full-sized avatar
💭
Learning as a past time activity

BlisS HectorBlisS

💭
Learning as a past time activity
View GitHub Profile
@HectorBlisS
HectorBlisS / GoogleAuthenticationCurl.sh
Created May 30, 2023 03:37 — forked from LindaLawton/GoogleAuthenticationCurl.sh
Curl bash script for getting a Google Oauth2 Access token
# Tutorial https://www.daimto.com/how-to-get-a-google-access-token-with-curl/
# YouTube video https://youtu.be/hBC_tVJIx5w
# Client id from Google Developer console
# Client Secret from Google Developer console
# Scope this is a space seprated list of the scopes of access you are requesting.
# Authorization link. Place this in a browser and copy the code that is returned after you accept the scopes.
https://accounts.google.com/o/oauth2/auth?client_id=[Application Client Id]&redirect_uri=http://127.0.0.1&scope=[Scopes]&response_type=code
# Exchange Authorization code for an access token and a refresh token.
@HectorBlisS
HectorBlisS / useBlurImage.tsx
Created May 16, 2023 23:07
Youtube_useBlurImage
import { useEffect, useState } from "react";
export const useDynamicSrc = (hd: string, low: string) => {
const [src, set] = useState(low ?? "");
useEffect(() => {
const img = new Image();
img.src = src;
img.onload = () => {
@HectorBlisS
HectorBlisS / EmailForm.tsx
Last active April 26, 2023 14:25
Youtube_forgot_password
export const EmailForm = ({
isLoading,
error,
}: {
isLoading?: boolean;
error?: string | null;
}) => (
<section>
<FeedbugDialog
isOpen={true}
@HectorBlisS
HectorBlisS / [charId].js
Created March 29, 2023 03:05
Vista de lista y vista de detalle con Next y rick & morty API
import { useRouter } from "next/router"
export default function Char(){
const router = useRouter()
const {charId} = router.query
return (
<h2>Detalle de {charId} </h2>
)
}
import { Children, createContext, useContext, type ReactNode } from "react";
const dialogContext = createContext<Record<string, any>>({});
type DialogProps = {
isOpen?: boolean;
children: any;
onClose?: () => void;
};
export default function Dialog({
@HectorBlisS
HectorBlisS / sendMail.server.ts
Last active December 20, 2022 03:01
Flujo de suscripción
import jwt from 'jsonwebtoken';
import nodemailer from 'nodemailer';
export const verify = (token: string) => {
return new Promise((res) => {
jwt.verify(token, 'blissmo', (error, info) => {
if (error) {
return res({ message: error.message, isError: true });
}
return res(info);
@HectorBlisS
HectorBlisS / index.html
Created November 29, 2022 17:10
Proyecto 1 | Spotify Player
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Primer proyecto</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css">
<link rel="stylesheet" href="style.css">
<script defer src="index.js"></script>
import { json } from '@remix-run/node';
import { Form, useActionData, useTransition } from '@remix-run/react';
import { useEffect, useRef } from 'react';
import useRecorder from '~/components/useRecorder';
import fs from 'fs';
export const action = async ({ request }) => {
const formData = await request.formData();
const file = formData.get('audio');
const ab = await file.arrayBuffer();
import type { Product } from '@prisma/client';
import type { LoaderFunction } from '@remix-run/node';
import { Link, useLoaderData } from '@remix-run/react';
import { db } from '~/db/db.server';
interface LoaderData {
products: Product[];
count: number;
pageNumber: number;
}