Skip to content

Instantly share code, notes, and snippets.

View jpedroribeiro's full-sized avatar
🇧🇷

J. Pedro Ribeiro jpedroribeiro

🇧🇷
View GitHub Profile
@jpedroribeiro
jpedroribeiro / inlined-pseudo-localization.js
Created April 30, 2021 10:00
Pseudo-Localization script
/*
Quick copy and paste solution for pseudo-localization
Based on from https://github.com/tryggvigy/pseudo-localization, go there for options and customisations
1 - Open dev tools
2 - Paste this code
3 - Text on the page should be pseudo-localized
*/
@jpedroribeiro
jpedroribeiro / getNestedPropValWithDotNotation.js
Last active June 12, 2023 09:48
How to get a nested property of an object with dot notation
/*
* Returns the value of a property in a nested object.
*
* @param {Object} sourceObject
* @param {string} dotNotationPath
* @returns {*}
*
*/
function getPropValue(sourceObject, dotNotationPath) {
@jpedroribeiro
jpedroribeiro / _customNextHead.js
Created November 9, 2018 12:21
Custom Head, copied from "next/document"
/*
* This Next.js custom Head component adds a flag to enable/disable the
* insertion of link preload for the JS files.
*
* Basically it's a copy/paste from "next.js/packages/next/pages/_document.js"
* (source: https://github.com/zeit/next.js) in which I've extracted the Head component.
*
* Tries to solve https://github.com/zeit/next.js/issues/4634
*
* Next.js version 7.0.2