To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion
import { useCallback, useState, useMemo } from 'react'; | |
/** | |
* Custom React hook to manage state with clearable functionality. | |
* | |
* @template ValueType The type of the state value. | |
* @template ClearType The type representing the cleared value. | |
* | |
* @param {ValueType | ClearType} initialValue - The initial value of the state. | |
* @param {ClearType} clearValue - The value to which the state will be cleared. |
import { useState, useMemo } from "react"; | |
// Usage example (booleans) | |
const userActivity = useStatus([true, false]); | |
userActivity.status; // true | |
userActivity.toggle(); | |
userActivity.setTrue(); | |
userActivity.setFalse(); | |
userActivity.reset(); |
[ | |
"aahed", | |
"aalii", | |
"aargh", | |
"aarti", | |
"abaca", | |
"abaci", | |
"aback", | |
"abacs", | |
"abaft", |
const dictionary = require("./words.json"); | |
class Wordle { | |
static DEFAULT_ALPHABET = Array.from({ length: 26 }, (_, i) => String.fromCharCode(i + 97)); | |
static DEFAULT_DICTIONARY = []; | |
static DEFAULT_SIZE = 5; | |
static calcLetterFrequency(words = []) { | |
return words.reduce((freqs, word) => { | |
for (const letter of word) { |
[{ | |
"title": "Like a Rolling Stone", | |
"artist": "Bob Dylan", | |
"album": "Highway 61 Revisited", | |
"released": "1965-08-30", | |
} | |
{ | |
"title": "(I Can't Get No) Satisfaction - Mono Version", | |
"artist": "The Rolling Stones", |
# Hide | |
defaults write com.apple.finder CreateDesktop false; killall Finder | |
# Show | |
defaults write com.apple.finder CreateDesktop true; killall Finder |
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
{ | |
error: { | |
message: "One or more fields appear to be incorrect", // this is the main error message to show users (e.g. at the top of the form) | |
developer_message: "This is a message for developers to help diagnose the problem", // optional | |
reasons: [ | |
{ | |
param: "email", | |
message: "Please enter a valid email address", | |
}, | |
{ |
export default withPassThroughProps({ | |
whiteList: false, /* blacklist these props */ | |
propNames: [...brands, ...sizes], | |
})(SomeComponent); |
# Ensure current directory is the script directory | |
WORKDIR=`dirname "$0"` | |
cd ${WORKDIR} |