You must use Storybook with webpack5!
npx sb@next init --builder webpack5
Remember to install all nedded packages because debugging babel
deps might be tricky.
Enjoy!
<?php | |
/** | |
* WordPress opcache preloading. | |
* Requires PHP >= 7.4. | |
* | |
* @author Konrad Fedorczyk <contact@realhe.ro> | |
* @link https://stitcher.io/blog/preloading-in-php-74 | |
* | |
* @version 1.0.0 | |
*/ |
#!/bin/bash | |
# Check if a PID was provided | |
if [ -z "$1" ]; then | |
echo "Usage: $0 <pid>" | |
exit 1 | |
fi | |
PID=$1 | |
OUTPUT_FILE="usage.txt" |
/* eslint-disable no-console */ | |
/* eslint-disable react-hooks/exhaustive-deps */ | |
import { useState, useEffect } from "react"; | |
export const useLocalStorage = <T>(key: string, initialValue: T) => { | |
const [storedValue, setStoredValue] = useState<T | undefined>(); | |
const setValue = (value: T) => { | |
window.localStorage.setItem(key, JSON.stringify(value)); | |
}; |
import React from "react"; | |
import { DocsContainer as BaseContainer } from "@storybook/addon-docs/blocks"; | |
import { useDarkMode } from "storybook-dark-mode"; | |
import { themes } from "@storybook/theming"; | |
export const DocsContainer = ({ children, context }) => { | |
const dark = useDarkMode(); | |
return ( | |
<BaseContainer |
<?php | |
function generate_unique_hex_string($length) { | |
// Calculate the number of bytes needed for the desired length of the hexadecimal string | |
$byte_length = ceil($length / 2); | |
// Generate random bytes | |
$random_bytes = random_bytes($byte_length); | |
// Convert the random bytes to a hexadecimal string | |
$hex_string = bin2hex($random_bytes); |
You must use Storybook with webpack5!
npx sb@next init --builder webpack5
Remember to install all nedded packages because debugging babel
deps might be tricky.
Enjoy!
(function($, undefined){ | |
/** | |
* acf | |
* | |
* description | |
* | |
* @date 14/12/17 | |
* @since 5.6.5 | |
* |
<?php | |
/** @constant string THEME_NAME **/ | |
define( 'THEME_NAME', get_option('stylesheet') ); | |
/** | |
* Custom script | |
*/ | |
function my_scripts_method() { | |
wp_enqueue_script( | |
'custom-script', |