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
<script type="text/html" id="item_tmpl"> | |
<div id="<%=id%>" class="<%=(i % 2 == 1 ? " even" : "")%>"> | |
<div class="grid_1 alpha right"> | |
<img class="righted" src="<%=profile_image_url%>"/> | |
</div> | |
<div class="grid_6 omega contents"> | |
<p><b><a href="/<%=from_user%>"><%=from_user%></a>:</b> <%=text%></p> | |
</div> | |
</div> | |
</script> |
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/react@18.3.0-next-8e17bfd14-20230322"; | |
import ReactDOMServer from 'https://esm.sh/react-dom@18.3.0-next-8e17bfd14-20230322/server'; | |
import ReactServerDOMServer from 'https://esm.sh/react-server-dom-webpack@18.3.0-next-8e17bfd14-20230322/server.browser'; | |
import ReactServerDOMClient from 'https://esm.sh/react-server-dom-webpack@18.3.0-next-8e17bfd14-20230322/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
<!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
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
// Based on: https://web.dev/optimize-long-tasks/ | |
window.yieldToMain = function yieldToMain(task) { | |
return new Promise(resolve => { | |
setTimeout(() => { | |
task && task(); | |
resolve(); | |
}, 0); | |
}); | |
} |
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
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
/** @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
const phases = [{ | |
phase: "new", | |
min: 0, | |
max: 1 | |
}, | |
{ | |
phase: "waxing crescent", | |
min: 1, | |
max: 6.38264692644 | |
}, |
NewerOlder