This file contain early ideas, useful links or quick gists during the working
- commitlint shouted when propose PR for spectrum #1 (comment)
- ampersand & in type script, which I found on Spectrum
tableRow
file https://stackoverflow.com/a/38317664 - gutenberg used
showdown
to convert markdown into html https://github.com/WordPress/gutenberg/blob/3da717b8d0ac7d7821fc6d0475695ccf3ae2829f/packages/blocks/src/api/raw-handling/markdown-converter.js#L7
- Installed gutenberg-everywhere-chrome on local, hit node error when running
yarn
, install different node usingnvm
- 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
- 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
- When pulling update from a forked repo, I realize
origin
is only for the forked one, not the origin repo https://stackoverflow.com/a/3903835
- Aksed ChatGPT for the nvm trick
On macos terminal, I have to run this line
source ~/.nvm/nvm.shwhenever I run nvm, how to keep it persistent
- Looping through some design systems, found out the Cloudspace Design System for AWS, there is a remarkable component for preference screen https://cloudscape.design/components/collection-preferences/?tabId=playground
- More on this https://cloudscape.design/components/collection-preferences/?tabId=playground
- Trying to figure the
stats
param when using webpack API for node: https://webpack.js.org/api/stats/
- Login firebase from gitpod: it can not be redirect back to the workspace url, follow this to get the code from terminal https://stackoverflow.com/a/39620597
- Explain for why some
fetch
with cors headers can not read the content-disposition, https://stackoverflow.com/a/43345889 - work around matthew-andrews/isomorphic-fetch#67 (comment)
- Exploring Shopify API with custom app https://github.com/Shopify/shopify-api-js/blob/main/docs/guides/custom-store-app.md
- In firebase function .env should be in the same folder with /functions folder https://stackoverflow.com/a/71151274
- Shopify did not support order name in API? Like #1001? https://nozzlegear.com/shopify/looking-up-a-shopify-order-by-its-name
- Can we get the order id from liquid and it the id instead of order number? -> That's work
{{ order_id }}
- Can we get the order id from liquid and it the id instead of order number? -> That's work
- Some notes about res.params and res.query https://stackoverflow.com/a/9243020
- 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
- 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
⬢ 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
- 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 templateline_items
only
- Want to intercept the browser navigation? This can be useful, though not support Firefox yet https://developer.mozilla.org/en-US/docs/Web/API/Window/navigation
- Firebase mysterios non-firebase services https://www.reddit.com/r/Firebase/comments/j35qii/what_are_nonfirebase_services_costs/
- For my case, seems like the cost is for the minimum instance to wake
- Tip to render React app to iframe with MUI: https://emotion.sh/docs/@emotion/cache#container
- Reminder: user
container
prop to target the iframe document
- Heads up: http-proxy-middle Readme showing document for 2.0 version, but responseInterceptor example is for 3.0. Reference
- 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
- LiquidJs custom filter https://stackoverflow.com/a/73837391
- Forked jsfiddle for the filter demostration https://jsfiddle.net/g20he91c/
- JS .closest() method includes the element itself when traverse
- 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
- Need to control youtube embeddable iframe? Dont forget
enablejsapi
https://stackoverflow.com/a/15165166 more https://developers.google.com/youtube/iframe_api_reference
- Grab vimeo thumbnails from the URL? https://coderwall.com/p/fdrdmg/get-a-thumbnail-from-a-vimeo-video. Good format is https://depone.dev/video/ followed
https://vimeo.com/api/v2/video/{videoId}.json
- Turns out there are a whole bunch of website builders that target artists:
- 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
- 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
- Using
tree
for print directory on macos, install it first using brew - tree -I 'node_modules|another_folder'
- 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 bespace/ellastudio2_tvmfww.mp4
- Detach the forked repo https://stackoverflow.com/a/18390313
- Alternate DOM API in Cloudflare
- Need to repeat a string for testing purpose? Use this https://www.browserling.com/tools/text-repeat
- Got issue when running gulp on jonsuh/hamburgers, turns out the gulp config is outdated while the current gulp version is 4. https://stackoverflow.com/a/54719495
- Github action to auto bump version https://github.com/marketplace/actions/github-tag, nit: change the correct branch name
- Github API to get the version https://stackoverflow.com/a/64583781
- MUI select component onChange expects second param as the new value https://stackoverflow.com/a/74079987, not the event param
- https://datasette.io/ for importing csv and query them using SQL syntax
HTMLRewriter is a poor fit for HTML scraping. It’s API is geared towards rewriting a HTML response, not extracting data from it
- CRA did not allow to use location directly, window.location works https://stackoverflow.com/a/44998181
- .slice(0,-1) to get the array from beginning to second-to-last items
- By default Cloudflare HTMLRewriter sanitize the content in .before() or .after(), we need to set the contentOptions in order to parse correct html cloudflare/workers-types#9 (comment)
- Extract image metadata on browser using https://mutiny.cz/exifr/
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))
- 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
gfm
may stands for Github Flavored Markdown in some document
In version 6 of React Router, the useHistory() hook is replaced with useNavigate().
- loadjs won't recognize google font as CSS file, force it as CSS file using: 'css!https://fonts.googleapis.com/icon?family=Material+Icons',
- Util for detecting image load status https://stackoverflow.com/a/1977898
- 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
- jsonforms tester methods for control https://github.com/eclipsesource/jsonforms/blob/7e0115feeced7711b0768d325566aaa6b054c32b/packages/core/src/testers/testers.ts#L225
- https://stackoverflow.com/questions/32070303/uncaught-referenceerror-react-is-not-defined#comment126569922_68876239
- Use
keyof
to get array of props from interface https://stackoverflow.com/a/62477194, WRONG: it returns type, not value https://blog.logrocket.com/how-to-use-keyof-operator-typescript/
- Usage of ArgTable to display arg table with controls, some more discussions on the story selection
- SO deep comment about display, opacity and visibility attribute
- Open source keystroke caption for MAC https://github.com/keycastr/keycastr
- How to access an object from an object nested function with this keyword? - just use the var name, eg: popup_data
- https://github.com/lmstudio-ai to run llm model without manuall run llama.cpp