Skip to content

Instantly share code, notes, and snippets.

View nucliweb's full-sized avatar

Joan León nucliweb

View GitHub Profile
@nucliweb
nucliweb / Resource Hints
Created September 10, 2021 09:34 — forked from droom/Resource Hints
Hints to the browser that might prime the pump for resources you will need. PreLoad is the only exception here, being more of an instruction than just a hint.
by Addy Osmani (@addyosmani)
https://twitter.com/addyosmani/status/743571393174872064
———
Preresolve DNS hostnames for assets
<link rel="dns-prefetch" href="https://my-site.com">
Begin a connection handshake in the background
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@nucliweb
nucliweb / list-link-rels.js
Created August 31, 2021 08:30
Snippet to list the link elements with some web performance "rel" attribute
@nucliweb
nucliweb / Network-Throttling.md
Last active November 25, 2022 22:34
Network Throttling Profile

Throttling

Network Throttling Profile

Network Download (kbit/s) Upload (kbit/s) Latency (ms)
3G | 3G (Basic) 307.2 102.4 0
3G | HSPA 7372.8 1536 0
3G | HSPA+ 21504 4096 0
3G | DC-HSPA+ 43008 8192 0
@nucliweb
nucliweb / FromMiditoHue.js
Created February 23, 2021 14:17
FromMiditoHue
const hueRange = {
min: 0,
max: 360
}
const midiRange = {
min: 36,
max: 96
}
const fromMidiToHue = (value) => {
const midiTotalValues = midiRange.max - midiRange.min

Backlog

CSS

  • Critical CSS
  • CSS analytics with Project Wallace
  • CSS Houdini
  • PurgeCSS to optimize your CSS

Web Performance

@charset "UTF-8"; /*! normalize.css v3.0.2 | MIT License | git.io/normalize */
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%
}
body {
margin: 0
}
@nucliweb
nucliweb / download-images.js
Created September 2, 2020 17:10
Download Images
function getImages(uri) {
var request = require('request');
var url = require('url');
var cheerio = require('cheerio');
path = require('path')
var fs = require('fs');
request(uri, function (error, response, body) {
if (!error && response.statusCode == 200) {
$ = cheerio.load(body)
@nucliweb
nucliweb / index.html
Created August 11, 2020 10:25
mojo working
<canvas id="canvas"></canvas>
<canvas id="postprocessing"></canvas>
<script id="shader-fs" type="x-shader/x-fragment">
precision highp float;
uniform sampler2D uImage;
uniform vec2 uResolution;
uniform float uTime;
varying vec2 vTexCoord;
void main() {
@nucliweb
nucliweb / .hiper.js
Created August 6, 2020 17:15
.hiper.js
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',