See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
<div style="background: center top / cover no-repeat, linear-gradient(180deg, rgba(3, 120, 124, 0.2) 0%, rgba(3, 120, 124, 0.8) 100%);"> | |
<div style="height: 100vh;background: linear-gradient(transparent 5%, rgba(3, 120, 124, 0.06) 30%, rgba(3, 120, 124, 0.06)), linear-gradient(transparent 5%, rgba(255, 255, 255, 0.9) 30%, rgba(255, 255, 255, 0.9));" /> | |
</div> | |
@echo off | |
set /p branch=Branch (master): | |
set /p git_command=Git command (fetch): | |
if "%branch%"=="" set branch=master | |
if "%git_command%"=="" set git_command=fetch | |
for /d %%i in (%cd%\*) do ( | |
echo ************************************************************************* |
const getState = () => { | |
if (document.visibilityState === 'hidden') { | |
return 'hidden'; | |
} | |
if (document.hasFocus()) { | |
return 'active'; | |
} | |
return 'passive'; | |
}; |
============================================components/PickersActionBar.js============================================ | |
import { Button, Stack } from '@mui/material'; | |
import { useLocaleText } from '@mui/x-date-pickers/internals'; | |
export default function PickersActionBar({ onCancel, onAccept, disabled }) { | |
const { cancelButtonLabel, okButtonLabel } = useLocaleText(); | |
return ( | |
<Stack |
alias multipull="find . -mindepth 1 -maxdepth 1 -type d -print -exec git -C {} pull \;" | |
multipull |
import dayjs from "dayjs"; | |
import { round, isNil } from "lib/utils"; // from lodash | |
import numeral from "numeral"; | |
numeral.register("locale", "vi", { | |
delimiters: { | |
thousands: ".", | |
decimal: ",", | |
}, | |
abbreviations: { |
// function ---------------------------------------------------------- | |
// ex: stringFormat("its like python{0} format", 3) ==> its like python3 format | |
export function stringFormat(string) { | |
[...Array(arguments.length)].forEach( | |
(_, i) => (string = string.replace("{" + (i - 1) + "}", arguments[i])) | |
); | |
return string; | |
} | |
// add to String prototype ------------------------------------------- |
function stringToColor(string) { | |
let hash = 0; | |
let i; | |
for (i = 0; i < string.length; i += 1) { | |
hash = string.charCodeAt(i) + ((hash << 5) - hash); | |
} | |
let color = '#'; |