Skip to content

Instantly share code, notes, and snippets.

View jwcastillo's full-sized avatar
🏠
Working from home

José Wenceslao Castillo jwcastillo

🏠
Working from home
View GitHub Profile

Everything I do in this guide is mostly taken from the Arch Wiki, and is for Arch Linux, obviously this can probably be applied to other Linux distributions especially Arch based ones, this guide is for people who want a laptop with similar effciency they had on Windows or MacOS. I hate the excuse of having to compromise on Linux to have good battery or thermals on laptops.

Please think of this guide as more of a starting point, if you're serious about fully optimizing your laptop research your laptop and the hardware inside of it as that can get you even further down the rabbit hole.

This guide assumes you have a relatively modern laptop with at least an SSD from the factory, if you don't, don't worry you can still probably follow this guide perfectly, if you have 32-bit laptop I'm using 64-bit packages only, but there should be 32-bit packges in the Arch multilib repo, **just don't assume everything will work or not break your laptop, please read carefully, and don't copy and paste commands or edit co

@pmeenan
pmeenan / wpt-hints.md
Last active March 18, 2023 16:48
Testing Priority Hints with WebPageTest

Priority Hints is rolling out to Chrome in the 101 release which is currently available in the Dev/Beta channel of Chrome and available in WebPageTest when using the Chrome Canary browser selection.

To make it easier to experiment with priority hints (particularly for LCP images) without making production changes, I set up a couple of public Cloudflare Workers that can be used dynamically with WebPageTest to inject priority hints into existing pages and to preload arbitrary images when combined with WebPageTest's overrideHost script command.

Injecting Priority Hints

There is a cloudflare worker at hint.perf.workers.dev that will take a CSS selector from the x-hint HTTP header and add fetchpriority=high to any elements in the HTML that match the selector. The easiest way to experiment with this is to use Chrome's dev tools locally, identify the element that hosts the imag

@mlanin
mlanin / progress_bar.go
Created February 14, 2022 07:02
Create a nice progress bar using symbols
package progress_bar
import (
"strings"
"text/template"
)
// Options can be used to customize look of the progress bar. DefaultProgressOptions() has pretty good defaults.
type Options struct {
Fill string // The character(s) used to fill in the progress bar
@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
@aplocher
aplocher / data-dict-gen.sql
Created February 8, 2021 22:10
Generate a complete markdown data dictionary template, including a table of contents, for Azure DevOps wiki from a list of tables. Will also display PK and FK info
use my-database
go
declare @tableList table (Id int not null primary key identity, DatabaseName varchar(50), SchemaName varchar(50), TableName varchar(50), TableDescription varchar(max))
-- #### CONFIGURATION:
-- Which tables to generate the markdown for?
insert into @tableList (DatabaseName, SchemaName, TableName, TableDescription) values
('my-database', 'dbo', 'Entity', ''),
@philipstanislaus
philipstanislaus / add_base_commit.sh
Last active December 1, 2023 10:58
Create empty git base commit for a full code review
# create empty base commit that will be the reference for our code review
git checkout --orphan base
git rm -r --cached .
git clean -fxd
git commit --allow-empty -m "Start of the review"
# create and checkout review branch that will include the latest code that should be reviewed
git checkout -b review
# merge main branch into that new review branch

Backlog

CSS

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

Web Performance

@tkadlec
tkadlec / perf-diagnostics.css
Last active March 20, 2025 08:41
CSS used to highlight potential performance issues
:root {
--violation-color: red; /* used for clear issues */
--warning-color: orange; /* used for potential issues we should look into */
}
/* IMAGES */
/*
* Lazy-Loaded Images Check
* ====