Skip to content

Instantly share code, notes, and snippets.

@misostack
Last active October 25, 2022 03:43
Show Gist options
  • Save misostack/ca515d133b38fa6934d1a1344892a0a0 to your computer and use it in GitHub Desktop.
Save misostack/ca515d133b38fa6934d1a1344892a0a0 to your computer and use it in GitHub Desktop.
WEB CHEATSHEET

WEB CHEATSHEET

What is the maximum length of a url in different browsers?

https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers#:~:text=Short%20answer%20%2D%20de%20facto%20limit,of%20client%20and%20server%20software.

image

KB to string

https://stackoverflow.com/questions/1515884/using-javascript-to-truncate-text-to-a-certain-size-8-kb

image

function toBytesUTF8(chars) {
    return unescape(encodeURIComponent(chars));
}
function fromBytesUTF8(bytes) {
    return decodeURIComponent(escape(bytes));
}

function truncateByBytesUTF8(chars, n) {
    var bytes= toBytesUTF8(chars).substring(0, n);
    while (true) {
        try {
            return fromBytesUTF8(bytes);
        } catch(e) {};
        bytes= bytes.substring(0, bytes.length-1);
    }
}

image

Which size should you choose to create a text column in MYSQL?

https://chartio.com/resources/tutorials/understanding-strorage-sizes-for-mysql-text-data-types/#:~:text=TINYTEXT%3A%20255%20characters%20%2D%20255%20B,requires%20a%201%20byte%20overhead.

image

What are common Authorization Models?

https://casbin.org/docs/en/supported-models

image

RBAC

image image image image image image image image image image image

image image image image image

image image image image image image

@misostack
Copy link
Author

Optimize and secure your images

Performance

  1. Size
  2. Quality
  3. Preload
  4. Lazy load
  5. Caching
  6. CDN
  7. SVG

SEO

  1. Alt
  2. Title
  3. Specific image's size : width, height
  4. FCP : first content paintful
  5. Adaptive and responsive images
  6. image/webp format
  7. Place holder

Security

  1. External images
  2. SVG
  3. CDN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment