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
| // Alternative code, from my tweet: | |
| // Generic, reusable Banner component | |
| function Banner({ type, children }) { | |
| const bg = type === 'success' ? 'green' : 'red'; | |
| return ( | |
| <div | |
| className={styles.banner} | |
| style={{ backgroundColor: bg }} |
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
| <?php | |
| /** | |
| * You'll need to replace | |
| * "https://phpc.social/@salcode" | |
| * with your own Mastodon URL. | |
| * and place this code somewhere executible (e.g. mu-plugins) | |
| */ | |
| add_action( 'wp_head', function() { | |
| if ( ! is_front_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
| import titleCase from '.'; | |
| const data = [ | |
| { | |
| value: 'lord of the flies', | |
| expected: 'Lord of the Flies', | |
| }, | |
| { | |
| value: 'once upon a time', | |
| expected: 'Once Upon a Time', |
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
| # Add this code to .zshrc after nvm initialization code. | |
| # | |
| # Check the current directory for a package.json file | |
| # If the node version is defined (at .engines.node) | |
| # run "nvm use" for the node version. | |
| # | |
| # If there is not a node version defined with package.json, | |
| # run "nvm use default" | |
| # Version: 20230112 | |
| # |
OlderNewer