Una serie de talleres y recursos para que podamos comenzar a implementar buenas prácticas en nuestros diseños y desarrollos:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// deno run --allow-net rsc.jsx | |
// deno run --allow-net https://gist.githubusercontent.com/pazguille/a2e3792c1901e12e67453ccb19cc0da6/raw/752200e809993fd2176381b7b09d8308dca6d069/rsc.jsx | |
import { serve } from 'https://deno.land/std/http/server.ts'; | |
import React, { Suspense } from "https://esm.sh/[email protected]"; | |
import ReactDOMServer from 'https://esm.sh/[email protected]/server'; | |
import ReactServerDOMServer from 'https://esm.sh/[email protected]/server.browser'; | |
import ReactServerDOMClient from 'https://esm.sh/[email protected]/client'; | |
function Hello({ name }) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on: https://web.dev/optimize-long-tasks/ | |
function postTask(task, opts) { | |
return task && scheduler.postTask(task, opts); | |
} | |
function yieldToMain(task) { | |
return new Promise(resolve => { | |
setTimeout(() => { | |
task && task(); | |
resolve(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.requestIdleCallback = window.requestIdleCallback || function (cb) { | |
var start = Date.now(); | |
return setTimeout(function () { | |
cb({ | |
didTimeout: false, | |
timeRemaining: function () { | |
return Math.max(0, 50 - (Date.now() - start)); | |
} | |
}); | |
}, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener('load', () => { | |
window.requestIdleCallback = window.requestIdleCallback || function (cb) { | |
const start = Date.now(); | |
return setTimeout(function () { | |
cb({ | |
didTimeout: false, | |
timeRemaining: function () { | |
return Math.max(0, 50 - (Date.now() - start)); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function readingTime(txt) { | |
const wpm = 225; // average adult reading speed (words per minute). | |
const words = txt.trim().split(/\s+/).length; | |
const time = Math.ceil(words / wpm); | |
return time; | |
} | |
const time = readingTime( | |
document.querySelector("article").innerText | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @jsx h */ | |
/** @jsxFrag Fragment */ | |
import { Fragment, h } from "https://esm.sh/preact"; | |
import { render } from "https://esm.sh/preact-render-to-string"; | |
function HelloWorld({ name }) { | |
return <p>Hello {name}!</p>; | |
} | |
const html = await render( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="es-AR"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="HandheldFriendly" content="True" /> | |
<link rel="preconnect" href="https://www.dolarsi.com" /> | |
</head> | |
<body> | |
<script type="text/partytown"> | |
window.dataLayer = window.dataLayer || []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const phases = [{ | |
phase: "new", | |
min: 0, | |
max: 1 | |
}, | |
{ | |
phase: "waxing crescent", | |
min: 1, | |
max: 6.38264692644 | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const signs = { | |
1: day => day <= 19 ? 'capricorn' : 'aquarius', | |
2: day => day <= 18 ? 'aquarius' : 'pisces', | |
3: day => day <= 20 ? 'pisces' : 'aries', | |
4: day => day <= 19 ? 'aries' : 'taurus', | |
5: day => day <= 20 ? 'taurus' : 'gemini', | |
6: day => day <= 20 ? 'gemini' : 'cancer', | |
7: day => day <= 22 ? 'cancer' : 'leo', | |
8: day => day <= 22 ? 'leo' : 'virgo', | |
9: day => day <= 22 ? 'virgo' : 'libra', |
NewerOlder