Skip to content

Instantly share code, notes, and snippets.

View andreuscafe's full-sized avatar

Andrés Nicolás Tonello andreuscafe

View GitHub Profile
@andreuscafe
andreuscafe / reveals.jsx
Created May 17, 2022 20:33
Code for textreveals and appearing animations with framer motion
const TextReveal = ({ text, WrapperComponent = motion.span }) => {
const isMobile = useMediaQuery('(max-width: 820px)');
const controls = useAnimation();
const [ref, inView] = useInView({ threshold: isMobile ? 0.3 : 0.5 });
useEffect(() => {
if (inView) {
controls.start('visible');
}
}, [controls, inView]);
@andreuscafe
andreuscafe / linkedinAutoAccepter.js
Last active December 10, 2021 19:26
Run this script over https://www.linkedin.com/mynetwork/invitation-manager/ to accept all your invitations
document.querySelectorAll('[aria-label*="Aceptar"]').forEach(b => b.click())
var cameraZ = camera.position.z;
var planeZ = 5;
var distance = cameraZ - planeZ;
var aspect = viewWidth / viewHeight;
var vFov = camera.fov * Math.PI / 180;
var planeHeightAtDistance = 2 * Math.tan(vFov / 2) * distance;
var planeWidthAtDistance = planeHeightAtDistance * aspect;
// or
// Hacer una función que retorne AL AZAR, una palabra mal escrita y al lado su corrección, como por ejemplo:
// "Almondiga",
// "Setiembre",
// "Dentrífico",
// "Pastaflora",
// "Tergopol",
// "Murciégalo",
// "Estuatua",
// "Sambuche",
// "Captus",
function getDaysOfAMonth(month) {
let days;
if (
month == "enero"
|| month == "mayo"
|| month == "julio"
|| month == "octubre"
|| month == "diciembre"
) {
// Inicio del programa
// 1. Crear un diccionario de tarjetas y sus posibles valores de cuotas.
const tarjetas = [{
cardName: "Visa",
installments: [1, 3, 6, 9, 12]
},
{
cardName: "Mastercard",
installments: [1, 3, 6]
// Inicio del programa
// 1. It's a ghost
// 2. Recibir una tarjeta en particular
let card = "Mastercard";
// Fix: Comprobar que el usuario ingresó una tarjeta
if (card != undefined || card != null) {
let preferencia = undefined;
if (preferencia != undefined || preferencia != null) {
if (preferencia == "Frio") {
replatearseLaVida();
} else if (preferencia == "Caliente") {
calentarAgua();
if (tipoDeCafe != undefined || tipoDeCafe != null) {
// Inicio del programa
// 1. Recibir el número a evaluar
const num = 4;
// Fix: Comproboar si el valor es efectivamente un número o no
if (typeof num == "number") {
// Acá podemos estar seguros de que num es un número
// 2. Comprobar si el número es positivo, negativo o cero
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>Hola mundo</h1>