Skip to content

Instantly share code, notes, and snippets.

View krfong916's full-sized avatar
🦁
Organizing for a brighter future

Kyle Fong krfong916

🦁
Organizing for a brighter future
  • University of California, Santa Cruz
View GitHub Profile
@krfong916
krfong916 / what-forces-layout.md
Created September 30, 2021 19:05 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
@krfong916
krfong916 / notes.md
Last active August 26, 2021 02:51
The Bottomline Editor

Piece Table

  • Inventor of Piece Table == J Strother Moore, the inventor of the boyer-moore string search algorithm

Summaries

Atom Editor Experience Post

Big Idea: Piece Table encoded as a Splay tree for large file edits

A splay tree is useful because it provides efficient lookup for workloads with high locality.

Demonstrates the tradeoffs of representing edits as a list v. as a splay tree

@krfong916
krfong916 / framework-sizes.md
Created July 19, 2021 06:01 — forked from Restuta/framework-sizes.md
Sizes of JS frameworks, just minified + minified and gzipped, (React, Angular 2, Vue, Ember)

Below is the list of modern JS frameworks and almost frameworks – React, Vue, Angular, Ember and others.

All files were downloaded from https://cdnjs.com and named accordingly. Output from ls command is stripped out (irrelevant stuff)

As-is (minified)

$ ls -lhS
566K Jan 4 22:03 angular2.min.js
@krfong916
krfong916 / rabbitmq_notes.md
Created March 24, 2021 20:04 — forked from Dev-Dipesh/rabbitmq_notes.md
Why RabbitMQ is better over Redis and notes on RabbitMq.

Redis is Database whereas RabbitMQ was designed as a message router or message-orientated-middleware (mom), so I'm sure if you look for benchmarks, you'll find that RabbitMQ will outperform Redis when it comes to message routing.

RabbitMQ is written in Erlang which was specifically designed by the telecom industry to route messages, you get clustering out of the box due to it being written in Erlang which means in a clustered environment, RabbitMQ will outperform Redis even further.

Furthermore, you get guaranteed delivery of messages due to the AMQP protocol, in other words, if the network drops while consuming the message, the consumer won't be able to say thanks for the message, so the consumer will drop the message and Rabbit will requeue the message, if you publish a message and the queue didn't say thanks to the publisher due to network problems or timeouts, Rabbit will drop the message and the publisher will keep on trying to publish the message. You can have publish retries with backoff policies, so

OOP and DDD

OOP, DDD, User-Centered Design: it's huge because if you can create a mental-model of a business, you can create a software implementation of that business.

Strict-origin-when-cross-origin

What is it?

In general, the http referrer policy is about reducing the information that the referrer contains. The policy roughly translates to "you are now on this site (host) and you came from a certain site (referrer)"

Why it's important

Suppose you're on your user profile page on - site.com/user=id:1223122. If you navigate elsewhere (to a different url), the browser will report the url that you came from. If no referrer policy is set, url paths can unintentionally reveal user information! It's a good practice for information security to set a referrer policy header. Suppose we set strict-origin-when-cross-origin policy - what does that mean?

@krfong916
krfong916 / web-performance.md
Created February 20, 2021 08:21 — forked from stevekinney/web-performance.md
Web Performance Workshop

Web Performance

Requirements

Repositories

Storybook

Storybook

Repo

We have two repos in our project.

Swish
-------
|