Skip to content

Latest commit

 

History

History
190 lines (143 loc) · 12.5 KB

today-i-learn.md

File metadata and controls

190 lines (143 loc) · 12.5 KB

Summary

This file contain early ideas, useful links or quick gists during the working

09-02-2023

10-02-2023

  • Installed gutenberg-everywhere-chrome on local, hit node error when running yarn, install different node using nvm
  • Run source ~/.nvm/nvm.sh after install to not hit the nvm not found
  • Root cause: zsh shell https://stackoverflow.com/a/29183202
  • New extension similiar to grammarly: language tool lt-toolbar

16-02-2023

  • Hit error ERR_OSSL_EVP_UNSUPPORTED link when running nindo-app-demo
    • Use nvm to downgrade node to 16
  • Learn something new about react-query, checkout wp-calypso site-preview-link to see how the useMutation and useQuery is combine to fetch the data and modify it. Also note that the code is written in TS

17-02-2023

18-02-2023

19-02-2023

20-02-2023

22-02-2023

23-02-2023

  • After using compiler.run, don't forget to close it https://webpack.js.org/api/node/#run
  • Can we ignore status code and return the response regardless status? with axios validateStatus: function (status) { return true; // always resolve the promise }
  • Can not deploy firebase function, checking .firebaserc for correct project name facepalm
  • Failed to deploy, log shows that the require deps is not in functions package.json, trying copy the content to /functions... -> root cause is not all the files for functions is in same folder, workaround... https://github.com/cjmyles/firebase-monorepo

24-02-2023

  • When up project name in firebaserc, the test url will be updated accordingly facepalm
  • Shopify order in liquid expect .id is a number
  • Use env variable to check wether firebase is on server or emulator https://stackoverflow.com/a/60963496

25-02-2023

  • ⬢ functions: Failed to load function definition from source: FirebaseError: Failed to load environment variables from .env. can't know that env variables should not be started with FIREBASE_ facepalm

26-02-2023

  • To deal with webpack-obfuscator not work on firebase deployment, I loaded the deps inside the webpack callback instead of putting it outsite
  • On Shopify order status checkout.line_items but on email template line_items only

28-02023

02-03-2023

04-03-2023

05-03-2023

  • Firebase allow x-frame-options on emulator but not on production, need to explicit define this in proxy or in firebase config
  • react-app-rewired not taken in account? config-overrides.js is ignored? Keep an eye on config-overrides-path option in package.json to see if the overriden script is different

08-03-2023

09-03-2023

  • JS .closest() method includes the element itself when traverse

10-03-2023

  • Why features are missing on in-app browser like messenger or facebook? Use this library to detect the useragent and acts accordingly https://github.com/f2etw/detect-inapp, seems like ua-parser-js did not count on this

12-03-2023

13-03-2023

14-03-2023

  • Turns out there are a whole bunch of website builders that target artists:
    • Format.com: easy to use to tons of feature, custom code injection support
    • Artlogic: great for gallery, code injection is tight, but GTM supported
    • Artsy: great site for art works, integrated with deep zoom with openseadragon
    • Smugmug: looks great, tons of feature, but only css injection allow

16-03-2023

  • Storj object URL can be changed to serve raw files without download screen, more on this
  • Finding a provider to store the deepzoom images, the list goes down to Storj and Cloudflare R2. Both are generous on free tiers, but Storj seems slower than R2
  • Other images CDN like cloudinary, imagekitio, only pixelbin allow: batch upload, generous free tier, keep the folder structure in images URls, other will append random value to the images

17-03-2023

  • When running .sh file in the working directory, should give ./ before the name to tell the terminal to look at the file in the same folder or else it will look in PATH ./magick-slicer.sh input/Art.png -o slicer-output

21-03-2023

  • Using tree for print directory on macos, install it first using brew
  • tree -I 'node_modules|another_folder'

25-03-2023

  • Latest Polaris expect style at: import "@shopify/polaris/build/esm/styles.css"; instead of @shopify/polaris/styles.css
  • Get the public URl for the video player of cloudinary? Grab the link https://res.cloudinary.com/diibdgwza/video/upload/v1627385800/space/ellastudio2_tvmfww.mp4 and it will be space/ellastudio2_tvmfww.mp4

02-04-2023

03-04-2023

06-04-2023

14-04-2023

15-04-2023

19-04-2023

22-04-2023

  • HTMLRewriter is a poor fit for HTML scraping. It’s API is geared towards rewriting a HTML response, not extracting data from it

24-04-2023

28-04-2023

  • .slice(0,-1) to get the array from beginning to second-to-last items

06-May-2023

window.exifr.parse('https://images.squarespace-cdn.com/content/v1/5e2bd0e12d65b351475dae37/1668287141998-IK2C7FYRB02EKBJP0F6C/2022-ukraine-war-picture-story-first-place-1-81a7d6.jpg?format=2500w', {iptc: true}).then(exif => console.log(exif.ObjectName))

20-May-2023

  • Can not find github version on jsdelivr, using commit hash instead, make it https://cdn.jsdelivr.net/gh/{user}/{repo}@f7b7d6330709addbc70997ca73ca6aee65d8cbc6/src/highlight-block/index.js, stop at /src print the folder structure
  • More info jsdelivr/jsdelivr#18081

24-May-2023

  • gfm may stands for Github Flavored Markdown in some document

16-June-2023

In version 6 of React Router, the useHistory() hook is replaced with useNavigate().

17-June-2023

24-June-2023

28-June-2023

  • parent.postMessage(obj, 'whatever'); Uncaught DOMException: Failed to execute 'postMessage' on 'Window': An object could not be cloned., since the passed object has methods, need to sanitize it to JSON to continue

29-June-2023

14-Aug-2023

16-Aug-2023

23-Aug-2023

05-Sep-2023

08-Oct-2023