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 initialState = { | |
| password: '', | |
| confirmPassword: '' | |
| }; | |
| const [form, setForm] = useState(initialState); | |
| const [errorMessage, setErrorMessage] = useState(initialState); |
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
| <TextField | |
| onChange={evt => onFormChange('password', evt.target.value)} | |
| value={form.password} | |
| helperText={errorMessage.password || ''} | |
| /> |
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 onFormChange = (fieldName, value) => { | |
| const newForm = { …form }; | |
| newForm[fieldName] = value; | |
| newErrorMessage = getNewErrorMessage(newForm); | |
| setForm(newForm); | |
| setErrorMessage(newErrorMessage); | |
| }; |
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
| newForm = { | |
| password: "p", | |
| confirmPassword: "" | |
| } |
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
| newErrorMessage = { | |
| password: "Panjang password minimal 8 karakter dengan gabungan huruf dan angka", | |
| confirmPassword: "Konfirmasi Password baru tidak boleh kosong" | |
| } |
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
| { | |
| "development": { | |
| "username": "root", | |
| "password": "password", | |
| "database": "database_development", | |
| "host": "127.0.0.1", | |
| "dialect": "mysql", | |
| "operatorsAliases": false | |
| }, | |
| "test": { |
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 NVM_DIR="$HOME/.nvm" | |
| [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
| [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
| export PATH="$PATH":"$HOME/snap/flutter/common/flutter/.pub-cache/bin" | |
| export PATH="$PATH:$(yarn global bin)" | |
| export DENO_INSTALL="/$HOME/.deno" | |
| export PATH="$DENO_INSTALL/bin:$PATH" |
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 { render } from "solid-js/web"; | |
| import { createSignal, createEffect } from "solid-js"; | |
| type Option<T> = | |
| | { | |
| _tag: "Some"; | |
| value: T; | |
| } | |
| | { | |
| _tag: "None"; |
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
| fd --extension .ts --exec sed -i -z 's/{\n/{/g' {} \; && fd --extension .ts --exec sed -i -z 's/\[\n/\[/g' {} \; && fd --extension .ts --exec sed -i -z 's/(\n/(/g' {} \; && pnpm lint:fix |
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 function htmlToReadable(html: HTML): Readable { | |
| const asyncIterator = html[Symbol.asyncIterator](); | |
| return new Readable({ | |
| objectMode: false, | |
| read: async function() { | |
| const {value, done} = await asyncIterator.next(); | |
| if (done) { | |
| this.push(null); |