See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
{ | |
"contact": { | |
"firstName": "John", | |
"lastName": "Doe", | |
"phone": "+1 123 456 789", | |
"email": "[email protected]", | |
"linkedin": "https://www.linkedin.com/in/johndoe", | |
"summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat" | |
}, | |
"experiences": [ |
function chunk(items: string[], size: number) { | |
const chunks = []; | |
items = ([] as string[]).concat(...items); | |
while (items.length) { | |
chunks.push(items.splice(0, size)); | |
} | |
return chunks; | |
} |
export function formatCurrency( | |
value: number, | |
locales: string | string[] = 'id', | |
options: Intl.NumberFormatOptions = { style: 'currency', currency: 'IDR', minimumFractionDigits: 0 } | |
) { | |
return new Intl.NumberFormat(locales, options).format(value); | |
} | |
export function formatCurrencyWithoutPrefix(value: number, locales: string | string[] = 'id') { | |
return formatCurrency(value, locales, {}); |
'use client'; | |
import { type LinkProps } from 'next/link'; | |
import { useRouter } from 'next/navigation'; | |
import cn from 'classnames'; | |
type LinkPropsReal = React.PropsWithChildren< | |
Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof LinkProps> & LinkProps | |
>; |
# https://www.freecodecamp.org/news/how-to-search-files-in-the-linux-terminal/ | |
find -name <file_name> | |
# find file by "case-insensitive" | |
find -iname <file_name> | |
# find file by "regex / pattern" | |
find /path/to/search -name "*.txt" |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).
Use ssh keys and define host aliases in ssh config file (each alias for an account).
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"