function App({ x, loading }) {
const style = { width: x };
const jsx = <div style={style} />;
if (loading) {
return <span style={style}>Loading</span>;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>Safari bug: container-type breaks grid + transform media query on resize</title> | |
| <style> | |
| * { margin: 0; padding: 0; box-sizing: border-box; } | |
| .page { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| > next build | |
| ▲ Next.js 15.4.0-canary.3 | |
| - Experiments (use with caution): | |
| · swcPlugins | |
| ✓ reactCompiler | |
| Creating an optimized production build ... | |
| Files compiled with babel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| MIT License http://www.opensource.org/licenses/mit-license.php | |
| Author Tobias Koppers @sokra | |
| */ | |
| "use strict"; | |
| const glob2regexp = require("glob-to-regexp"); | |
| const { | |
| JAVASCRIPT_MODULE_TYPE_AUTO, |
The following example shows the result of bundling of css modules in the following setting:
"sideEffect": "true"for all packagespackage.json- barrel files
- mono repository
Because of "sideEffect": "true" webpack processes all imports when dealing with barrel files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // tested on: https://www.youtube.com/results?search_query=chrome+performance | |
| const styleElement = document.createElement("style"); | |
| styleElement.innerHTML = ` | |
| @property --unused-property-no-inherit { inherits: false } | |
| *, *:before, *:after { box-sizing: inherit } | |
| .opacity-30 { | |
| opacity: 0.3; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const styleElement = document.createElement("style"); | |
| styleElement.innerHTML = `@property --unused-property-no-inherit { inherits: false }` | |
| document.head.appendChild(styleElement); | |
| const styleSheet = styleElement.sheet; | |
| setTimeout(() => { | |
| performance.mark("inject html opacity 0.5"); | |
| console.log("add to <html> opacity: 0.5"); | |
| styleSheet.insertRule("html { opacity: 0.5 }", styleSheet.cssRules.length); | |
| }, 1000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| brew update | |
| brew install Cmake protobuf rust python | |
| git clone https://github.com/bfirsh/stable-diffusion.git | |
| git checkout apple-silicon-mps-support | |
| mkdir -p models/ldm/stable-diffusion-v1/ | |
| # accept license and download the model | |
| # sd-v1-4.ckpt from: | |
| # https://huggingface.co/CompVis/stable-diffusion-v-1-4-original |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| git fetch & | |
| MAIN_BRANCH="main" | |
| # detect master / main branch | |
| if [ "$(git rev-parse --quiet --verify $MAIN_BRANCH)" ]; then | |
| echo "main branch: ${MAIN_BRANCH}" | |
| else | |
| MAIN_BRANCH="master" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const actionCreator = <TState>() => <TOptions extends {}>( | |
| actionHandler: ActionHandler<TOptions, TState> | |
| ) => actionHandler; | |
| type ActionHandler<TOptions extends {}, TState extends {}> = ( | |
| state: TState, | |
| options: TOptions | |
| ) => TState; | |
| type ActionOptions<T> = T extends ActionHandler<infer TOptions, infer State> | |
| ? TOptions | |
| : never; |
NewerOlder