References:
- https://ant.design/docs/react/customize-theme
- https://github.com/santospatrick/cra-antd-theme
- https://github.com/ant-design/ant-design/blob/master/components/style/themes/default.less
| Signin Form | Signin Form as components |
|---|
| // .hyper.js | |
| // See https://hyper.is#cfg for all currently supported options. | |
| // After installing hyper, run the following: | |
| // hyper i hyper-dracula hypercwd hyper-active-tab | |
| module.exports = { | |
| config: { | |
| fontSize: 18, | |
| fontFamily: '"Meslo LG M for Powerline", Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace', | |
| fontWeight: 'normal', |
References:
| Signin Form | Signin Form as components |
|---|
| #!/usr/bin/env bash | |
| # 1. Run this script file | |
| # bash <(curl -Ls https://bit.ly/3swaoUr) | |
| # Homebrew & Apps | |
| /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
| echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/$USER/.zprofile | |
| eval "$(/opt/homebrew/bin/brew shellenv)" | |
| brew update |
| // =================== | |
| // Array Exercises | |
| // =================== | |
| // Reference: https://pokeapi.co/api/v2/pokemon?limit=10 | |
| const arr = [ | |
| { | |
| name: 'bulbasaur', | |
| url: 'https://pokeapi.co/api/v2/pokemon/1/', | |
| base_experience: 64, |
| // Sagas | |
| import { call, put } from 'redux-saga/effects' | |
| import api from 'services/api' | |
| export function* fetchUser(action) { | |
| const { data } = yield call(api.get, `/user/${action.id}`) | |
| yield put({ type: "@user/FETCH_SUCCEEDED", data }) | |
| } | |
| // Thunks |
| // ------------------ | |
| // SomeComponent.js | |
| // ------------------ | |
| function SomeComponent() { | |
| ... | |
| const getUser = id => { | |
| dispatch({ type: '@user/FETCH_REQUESTED', id }) | |
| } | |
| ... | |
| } |
| import axios from "axios"; | |
| class HttpService { | |
| constructor() { | |
| const token = window.localStorage.getItem("token"); | |
| const service = axios.create({ | |
| baseURL: process.env.REACT_APP_API_URL, | |
| headers: token | |
| ? { | |
| Authorization: `Bearer ${token}`, |
| #!/bin/sh | |
| STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E ".vue$|.js$") | |
| ESLINT="$(git rev-parse --show-toplevel)/node_modules/eslint/bin/eslint.js" | |
| if [[ "$STAGED_FILES" = "" ]]; then | |
| exit 0 | |
| fi | |
| PASS=true |
| // ES6 | |
| import removeAccents from 'remove-accents'; | |
| /** | |
| * Filter {@link list} based on any attribute by {@link searchString} | |
| * and return a new one | |
| * @param {string} searchString | |
| * @param {array<*>} list | |
| * @returns {array<*>} new filtered list | |
| */ |
| /** | |
| * @flow | |
| */ | |
| import RNFetchBlob from 'react-native-fetch-blob' | |
| const DocumentDir = RNFetchBlob.fs.dirs.DocumentDir | |
| const storagePath = `${DocumentDir}/persistStore` | |
| const encoding = 'utf8' |